Project

Profile

Help

Support #1356

closed

xsl:message causing "xsl:attribute" error

Added by Anonymous over 16 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Internals
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Legacy ID:
sf-1842220
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

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

tmp.xml (9.56 KB) tmp.xml Anonymous, 2007-12-01 07:22
adapt.xslt (9.56 KB) adapt.xslt Anonymous, 2007-12-01 07:22
adapt.xslt (9.56 KB) adapt.xslt Anonymous, 2007-12-01 07:23
Actions #1

Updated by Anonymous over 16 years ago

SourceForge user: jak09

Logged In: YES

user_id=1288215

Originator: YES

File Added: adapt.xslt

Actions #2

Updated by Anonymous over 16 years ago

SourceForge user: jak09

Logged In: YES

user_id=1288215

Originator: YES

File Added: adapt.xslt

Actions #3

Updated by Anonymous over 16 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

Also available in: Atom PDF