XPath ok, XSLT not

Here should go questions about transforming XML with XSLT and FOP.
amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

XPath ok, XSLT not

Post by amix »

I might be completley dumb, but I do not get over this:

Code: Select all


<xsl:template match="//body/descendant-or-self::node()">
[...]
</xsl:template>
The error I get is:

Code: Select all


Error in expression //body/descendant-or-self::node(): 
Axis in pattern must be child or attribute
If I use the same XPath in the oXygen XPath string input (upper left corner) I get the desired result.
Andreas
jkmyoung
Posts: 89
Joined: Mon Mar 06, 2006 10:13 pm

Post by jkmyoung »

I believe you're not allowed to use the descendant-or-self axis in the match pattern.
You might want to try something like this instead with a inverted condition instead:
<xsl:template match="node()[ancestor-or-self::body]">
amix
Posts: 81
Joined: Sat Aug 05, 2006 10:43 pm

Post by amix »

Thank you very much. That solved my issues. :-)
Andreas
Post Reply