Support #1356
closedxsl:message causing "xsl:attribute" error
0%
Description
SourceForge user: jak09
When I run the attached stylesheet on the attached xml using Saxon 9.0B, I get an error message
"Error at xsl:message on line 55 of file:/home/jak09/Workspace/Semantics/data/schemata/adapt.xslt:
XTDE0420: Cannot create an attribute node (rdo:semanticDistortion) whose parent is a document node"
However, when I turn on tracing (-T) it turns out that the error is being raised on line 55 which is
<xsl:message select="'multiply(',$sequence,') =',$result"/>
Commenting out this line removes the error and the stylesheet completes normally.
I think that this must be a bug.
Regards,
Joe.
Files
Updated by Anonymous almost 17 years ago
SourceForge user: jak09
Logged In: YES
user_id=1288215
Originator: YES
File Added: adapt.xslt
Updated by Anonymous almost 17 years ago
SourceForge user: jak09
Logged In: YES
user_id=1288215
Originator: YES
File Added: adapt.xslt
Updated by Anonymous almost 17 years ago
SourceForge user: mhkay
Logged In: YES
user_id=251681
Originator: NO
This looks like the problem described here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1837335&group_id=29872&atid=397617
This is fixed in 9.0.0.2, though probably not in the way you would want.
I assume that in your case $sequence (or perhaps $result) contains an attribute node. xsl:message does not atomize the result of the select expression, which is probably what your example is expecting. I suggest you replace $sequence by string($sequence) if this is the case.
As mentioned in the bug entry I've raised a bug against the XSLT spec because I think it needs to clarify what ought to happen in such cases.
Please register to edit this issue