[lxml-dev] questions about xslt with xml, where to get help?
Hi everyone I'm not completely sure whether this mailing list only intended to further develop lxml or as well for _users_ of lxml... but I haven't found any other mailing list / forum :-( I'm having problems with getting xsl transformation run. When i do: xslt_doc = etree.parse(stylesheet) transform = etree.XSLT(xslt_doc) result = transform(DOMdocument, **{statustext='some text', mode='navigation'}) the result will just be empty even tho in the documentation it is stated the paramters should be passed as keyword parameters... greetings Dominique Dominique Holzwarth | De La Rue International Limited Software Engineer dominique.holzwarth@ch.delarue.commailto:dominique.holzwarth@ch.delarue.com | tel: +41 (0) 31 997 56 13 | fax: +41 (0) 997 56 80 Berne Branch, Morgenstrasse 131, 3018 Berne, Switzerland | www.delarue.comhttp://www.delarue.com/ ***************************************************************************** This e-mail and any files attached are strictly confidential, may be legally privileged and are intended solely for the addressee. If you are not the intended recipient please notify the sender immediately by return email and then delete the e-mail and any attachments immediately. The views and or opinions expressed in this e-mail are not necessarily the views of De La Rue plc or any of its subsidiaries and the De La Rue Group of companies, their directors, officers and employees make no representation about and accept no liability for its accuracy or completeness. You should ensure that you have adequate virus protection as the De La Rue Group of companies do not accept liability for any viruses. De La Rue plc Registered No.3834125, De La Rue Holdings plc Registered No 58025 and De La Rue International Limited Registered No 720284 are all registered in England with their registered office at: De La Rue House, Jays Close, Viables, Hampshire RG22 4BS *****************************************************************************
Hi, Dominique.Holzwarth@ch.delarue.com wrote:
I'm not completely sure whether this mailing list only intended to further develop lxml or as well for _users_ of lxml...
both.
I'm having problems with getting xsl transformation run. When i do:
xslt_doc = etree.parse(stylesheet)
transform = etree.XSLT(xslt_doc)
result = transform(DOMdocument, **{statustext='some text', mode='navigation'})
the result will just be empty
this is the right way of doing it. I would expect a problem with your stylesheet. Stefan
On Wed, Jul 09, 2008 at 02:37:20PM +0100, Dominique.Holzwarth@ch.delarue.com wrote:
result = transform(DOMdocument, **{statustext='some text', mode='navigation'})
FWIW this code is equivalent to the simpler result = transform(DOMdocument, statustext='some text', mode='navigation') Marius Gedminas -- "I may not understand what I'm installing, but that's not my job. I just need to click Next, Next, Finish here so I can walk to the next system and repeat the process" -- Anonymous NT Admin
Well my posted code is for easy debugging / getting help only. Actually, the dict that'll be passed is generated somewhere else dynamicly, with varying keys etc. ;-) So I'll pass the dict by it's name and not pass the individual keys/values =)
-----Original Message----- From: lxml-dev-bounces@codespeak.net [mailto:lxml-dev-bounces@codespeak.net] On Behalf Of Marius Gedminas Sent: Mittwoch, 9. Juli 2008 20:56 To: lxml-dev@codespeak.net Subject: Re: [lxml-dev] questions about xslt with xml, where to get help?
On Wed, Jul 09, 2008 at 02:37:20PM +0100, Dominique.Holzwarth@ch.delarue.com wrote:
result = transform(DOMdocument, **{statustext='some text', mode='navigation'})
FWIW this code is equivalent to the simpler
result = transform(DOMdocument, statustext='some text', mode='navigation')
Marius Gedminas -- "I may not understand what I'm installing, but that's not my job. I just need to click Next, Next, Finish here so I can walk to the next system and repeat the process" -- Anonymous NT Admin
***************************************************************************** This e-mail and any files attached are strictly confidential, may be legally privileged and are intended solely for the addressee. If you are not the intended recipient please notify the sender immediately by return email and then delete the e-mail and any attachments immediately. The views and or opinions expressed in this e-mail are not necessarily the views of De La Rue plc or any of its subsidiaries and the De La Rue Group of companies, their directors, officers and employees make no representation about and accept no liability for its accuracy or completeness. You should ensure that you have adequate virus protection as the De La Rue Group of companies do not accept liability for any viruses. De La Rue plc Registered No.3834125, De La Rue Holdings plc Registered No 58025 and De La Rue International Limited Registered No 720284 are all registered in England with their registered office at: De La Rue House, Jays Close, Viables, Hampshire RG22 4BS *****************************************************************************
Hi, Dominique.Holzwarth@ch.delarue.com wrote:
result = transform(DOMdocument, **{statustext='some text', mode='navigation'})
this fails because there is no node called "some text" in your data. The parameter you pass is an XPath value, not a plain Python value, so if you want to pass a string instead of a node name, use "'some text'". Any patch to the docs will be appreciated. :) Stefan
participants (3)
-
Dominique.Holzwarth@ch.delarue.com
-
Marius Gedminas
-
Stefan Behnel