Sorry I forgot that important information :

What do you mean, 'nothing' when you tried to use it inside the view?

  The final XML file, that obtained of apply the XSL template to the
original XML, is not created.

What happened when you imported it? What happened when you called it?

When I import the converter.py and call the transformer function I got
a parseError in my browser, actually if I run the converter script
from my command line it works perfectly, that makes me think, may be,
that is another thing.

What errors did you get?
I got a parseError, I am writing a try and catch exception to get
errors.

One thing that is strange to me is :

I put the following lines in my views.py and every time that I add /
xslt to the end of my URL django execute these lines, and it works, so
why can not I take that file and apply it an XSL template?...

    template = loader.get_template("cvsanaly/committers.xml")
    result_render = render_to_string("cvsanaly/committers.xml", data)
    xml_file = open("/tmp/committers.xml","w")
    xml_file.writelines(result_render)
    xml_file.close()

I write a file and I want to apply the XSL template to that file as
follow, as you can see I put everything in /tmp, for testing
purpouses :

  styledoc = libxml2.parseFile("cvsanaly/committers.xsl") # get the
XSL template
  style = libxslt.parseStylesheetDoc(styledoc)
  doc = libxml2.parseFile("/tmp/committers.xml") # file which I want
to change
  result = style.applyStylesheet(doc, {"source":project}) # apply the
xsl template
  style.saveResultToFilename("/tmp/"+xml_name+"_xslt.xml", result, 0)
# write the final XML file.

Look so trivial but I do not get at all.

Thanks in advance again and best regards :D


On Jun 24, 6:02 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Jun 24, 3:53 pm, Francisco Rivas <taken...@gmail.com> wrote:
>
>
>
> > Hi everyone in both lists.
>
> > I created a XSL template and I want to apply it to an XML data (or file)
> > which I get from a django view, I mean, I have this snippet in my 
> > views.pyhttp://dpaste.com/59193/andI have this another snippet to apply an 
> > XSL
> > transformationhttp://dpaste.com/59194/( excuse for the commented lines ).
>
> > I tried this :
>
> > - sobprocess.popen to execute the script
> > - to use the script inside the view but nothing.
>
> > My idea is to call transformer function and pick the file and give it to
> > download.
>
> > Am I missing something?, Am I doing something wrong?...
>
> > Any kind of help would be appreciate. Thanks in advance and best regards. :D
>
> > --
> > Francisco Rivas
>
> What do you mean, 'nothing' when you tried to use it inside the view?
> What happened when you imported it? What happened when you called it?
> What errors did you get?
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to