Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

canonical xpath problems?

Tags:

xml

xslt

xpath

If a single dot is converted into self()::node() in xpath, Source

Then why does this work:

<xsl:value-of select="self::node()[name()='QWE']"/>

but not this?:

<xsl:value-of select=".[name()='QWE']"/>
like image 817
Troy Avatar asked Jan 18 '26 01:01

Troy


1 Answers

Because the expression

.[name()='QWE']

is illegal XPath 1.0 syntax, an abbreviated step may not contain a predicate. XPath 2.0 doesn't have this restriction.

like image 89
jelovirt Avatar answered Jan 19 '26 18:01

jelovirt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!