[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xsl-list
Subject:    [xsl] Re: Usage of Asterisk in XPath expressions
From:       "Philipp Nanz philipp.nanz () docufy ! de" <xsl-list-service () lists ! mulberrytech ! com>
Date:       2019-03-26 16:55:15
Message-ID: 20190326125435.49458 () lists ! mulberrytech ! com
[Download RAW message or body]

Hello folks,

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

Kind regards,

Philipp

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"
>        xmlns:foo="http://test/ns/foo"
>        version="2.0">
>
>        <xsl:template match="foo:bar">
>                <xsl:if test="ancestor-or-self::foo*[@a]">
>                        <xsl:copy>
>                                <xsl:value-of select="."/>
>                        </xsl:copy>
>                </xsl:if>
>        </xsl:template>
>
> </xsl:stylesheet>
>
> 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.
>
>   * Saxon 9.6: Stops with something that looks like an internal error
>   * Saxon 9.7: Says I need to enable XPath 3.1 to use this expression?!?
>   * 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,
>
> Philipp
>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/651070
or by email: xsl-list-unsub@lists.mulberrytech.com
--~--
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic