Project

Profile

Help

Bug #4114

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:
Normal
Assignee:
Category:
s9api API
Sprint/Milestone:
Start date:
2019-01-28
Due date:
% Done:

100%

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

Description

Hi,

I create this ticket as support one first but it seems to be a bug : when i set a traceListener for my XsltTransformer (s) in a pipeline, i get the following errors. Otherwise, the folllowing works fine


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 from Saxon - Support #4109: XSLT pipeline : Error XPDY0002 - The context item for axis step fn:root(…)/element() is absentClosedMichael Kay2019-01-24

Actions

Please register to edit this issue

Also available in: Atom PDF