[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Usage of Asterisk in XPath expressions

Subject: Re: Usage of Asterisk in XPath expressions
From: "Philipp Nanz philipp.nanz@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Mar 2019 16:54:37 -0000
 Re: Usage of Asterisk in XPath expressions
Hello folks,

that cleared it up for me, thank you very much! XPath 3.1 for the win :-)

Kind regards,


Am 22.03.2019 um 12:00 schrieb Philipp Nanz:
Hello there,

due to a typo, we missed the colon between the namespace prefix and
the wildcard in a XPath expression. To my surpise, this causes static
errors in some version of Saxon and runs flawlessly in others,
although I would expect this to be static error.

Suppose this data:

<foo:bar xmlns:foo="http://test/ns/foo" a="b">Yadda</foo:bar>

Then suppose this stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
B B B  xmlns:foo="http://test/ns/foo"
B B B  version="2.0">

B B B  <xsl:template match="foo:bar">
B B B B B B B  <xsl:if test="ancestor-or-self::foo*[@a]">
B B B B B B B B B B B  <xsl:copy>
B B B B B B B B B B B B B B B  <xsl:value-of select="."/>
B B B B B B B B B B B  </xsl:copy>
B B B B B B B  </xsl:if>
B B B  </xsl:template>


As you can see the colon is missing after the namespace prefix foo.
What baffles me is that different versions of Saxon exhibit different
behavious here, and especially newer versions don't seem to treat this
as a problem at all.

B * Saxon 9.6: Stops with something that looks like an internal error
B * Saxon 9.7: Says I need to enable XPath 3.1 to use this expression?!?
B * Saxon 9.8, 9.9: Don't run into an error at all

That makes me wonder: Is this an error at all? or is there some
wildcard feature or something in XPath 3.1 that I cam't find in the docs?

Thanks in advance for any insights!

Kind regards,


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.