Transform XML with a pack of templates using lxml
up vote
0
down vote
favorite
There is a XSL file (thexsltfile.xsl) which uses xsl:import other XSL in the same folder.
xml_filename = 'input.xml'
xsl_filename = 'thexsltfile.xsl'
dom = etree.parse(xml_filename)
xslt = etree.parse(xsl_filename)
transform = etree.XSLT(xslt)
newdom = transform(dom)
It shows an error message:
lxml.etree.XSLTApplyError: Failed to evaluate the expression of variable testvalue.
The testvalue is located at another XSL file which thexsltfile.xsl
is imported. It looks to me that the xsl:import
is not working.
Did I miss something?
xml python-2.7 xslt
add a comment |
up vote
0
down vote
favorite
There is a XSL file (thexsltfile.xsl) which uses xsl:import other XSL in the same folder.
xml_filename = 'input.xml'
xsl_filename = 'thexsltfile.xsl'
dom = etree.parse(xml_filename)
xslt = etree.parse(xsl_filename)
transform = etree.XSLT(xslt)
newdom = transform(dom)
It shows an error message:
lxml.etree.XSLTApplyError: Failed to evaluate the expression of variable testvalue.
The testvalue is located at another XSL file which thexsltfile.xsl
is imported. It looks to me that the xsl:import
is not working.
Did I miss something?
xml python-2.7 xslt
1
We can't diagnose errors for a description of the code. Post the XSLT.
– Mads Hansen
Nov 18 at 20:27
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
There is a XSL file (thexsltfile.xsl) which uses xsl:import other XSL in the same folder.
xml_filename = 'input.xml'
xsl_filename = 'thexsltfile.xsl'
dom = etree.parse(xml_filename)
xslt = etree.parse(xsl_filename)
transform = etree.XSLT(xslt)
newdom = transform(dom)
It shows an error message:
lxml.etree.XSLTApplyError: Failed to evaluate the expression of variable testvalue.
The testvalue is located at another XSL file which thexsltfile.xsl
is imported. It looks to me that the xsl:import
is not working.
Did I miss something?
xml python-2.7 xslt
There is a XSL file (thexsltfile.xsl) which uses xsl:import other XSL in the same folder.
xml_filename = 'input.xml'
xsl_filename = 'thexsltfile.xsl'
dom = etree.parse(xml_filename)
xslt = etree.parse(xsl_filename)
transform = etree.XSLT(xslt)
newdom = transform(dom)
It shows an error message:
lxml.etree.XSLTApplyError: Failed to evaluate the expression of variable testvalue.
The testvalue is located at another XSL file which thexsltfile.xsl
is imported. It looks to me that the xsl:import
is not working.
Did I miss something?
xml python-2.7 xslt
xml python-2.7 xslt
edited Nov 18 at 17:54
zx485
12.9k122845
12.9k122845
asked Nov 18 at 14:18
user3873113
176
176
1
We can't diagnose errors for a description of the code. Post the XSLT.
– Mads Hansen
Nov 18 at 20:27
add a comment |
1
We can't diagnose errors for a description of the code. Post the XSLT.
– Mads Hansen
Nov 18 at 20:27
1
1
We can't diagnose errors for a description of the code. Post the XSLT.
– Mads Hansen
Nov 18 at 20:27
We can't diagnose errors for a description of the code. Post the XSLT.
– Mads Hansen
Nov 18 at 20:27
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53361865%2ftransform-xml-with-a-pack-of-templates-using-lxml%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
We can't diagnose errors for a description of the code. Post the XSLT.
– Mads Hansen
Nov 18 at 20:27