Project

Profile

Help

Support #4109

closed

XSLT pipeline : Error XPDY0002 - The context item for axis step fn:root(…)/element() is absent

Added by hamdi karray about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
s9api API
Sprint/Milestone:
Start date:
2019-01-24
Due date:
% Done:

0%

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

Description

Please, I need some help dealing with saxon api :) I create a pipeline with 2 XsltTransform of the same xslt and when i run transform i get this error :

2019-01-24 11:32:15,673 [pool-2-thread-1] INFO e.s.e.x.XsltListener - file
2019-01-24 11:32:15,674 [pool-2-thread-1] INFO e.s.e.x.XsltListener - Error 
XPDY0002 while evaluating xsl:message content: The context item for axis 
step fn:root(...)/element() is absent
here is my xslt :
<xsl:stylesheet exclude-result-prefixes="#all" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:variable name="supp" as="xs:string" select="root()/*/name()"/>

<xsl:template match="/">
    <xsl:message select="$supp"/>
    <file/>
</xsl:template>
</xsl:stylesheet>

the first XsltTransform work fine but It seems that i have no context node during the second XstTransform running.

I use :

transformer1.setSource(source) : source is a SAXSource

transformer1.setDestination(transformr2)

transformr2.setDestination(serialiser)

According to documentation (XsltTransform.setInitialContextNode): This value is ignored in the case where the XsltTransformer is used as the Destination of another process. In that case the initial context node will always be the document node of the document that is being streamed to this destination.

Thanks for your Help


Related issues

Copied to Saxon - Bug #4114: XSLT pipeline : Error XPDY0002 - The context item for axis step fn:root(…)/element() is absentClosedMichael Kay2019-01-28

Actions
Actions #1

Updated by hamdi karray about 5 years ago

  • Copied to Bug #4114: XSLT pipeline : Error XPDY0002 - The context item for axis step fn:root(…)/element() is absent added
Actions #2

Updated by Michael Kay about 5 years ago

  • Status changed from New to Closed

Closing as this duplicates #4114.

Please register to edit this issue

Also available in: Atom PDF