Re: [xsl] matches() method in XPath 1.0

Subject: Re: [xsl] matches() method in XPath 1.0
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 31 Jan 2023 09:35:15 -0000
The spec seems to have been written to allow implementations to support later
XPath versions; whether any actual implementations have taken advantage of
that extensibility is another question.

Michael Kay
Saxonica

On 31 Jan 2023, at 02:37, Bauman, Syd
s.bauman@xxxxxxxxxxxxxxxx<mailto:s.bauman@xxxxxxxxxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>> wrote:

While I am not confident about it, I am not convinced that ITS does not permit
use of XPath 2.0. Why else is the @queryLanguage attribute of the <rules>
element defined as ( "xpath" | "css" | text )b unless you are permitted to
use values other than "xpath" (which means XPath 1.0) and "css" (which means
CSS3 selectors)? Section 5.3.4<https://www.w3.org/TR/its20/#d0e2761> discusses
what a processor need to to define another value, and furthermore reserves
"xpath2" (among others) for future use. Perhaps the future is now?

________________________________

I have a simple question, hopefully someone can help.



Given some nodes like this:



<text>Some text.</text>
<text>foo.svg</text>



in XPath 2.0 I can match the ones (like the second) that contain a file name
with something like



//text[matches(text(), '[^\s]*\.(svg|png|jpg)')]



That should match the second text node, and not the first.



I am looking for something to achieve the same purpose in XPath 1.0, even if
it's using something like ends-with instead of regex.



Why XPath 1.0? I'd love to use version 2.0 but this is for using the ITS data
categories, which seem not to be compatible with XPath
2.0https://www.w3.org/TR/its20/#d0e2513<https://nam12.safelinks.protection.ou
tlook.com/?url=https%3A%2F%2Fwww.w3.org%2FTR%2Fits20%2F%23d0e2513&data=05%7C0
1%7Cs.bauman%40northeastern.edu%7Cdd1ea7cc866c48ac181908db0321a7d4%7Ca8eec281
aaa34daeac9b9a398b9215e7%7C0%7C0%7C638107215359785885%7CUnknown%7CTWFpbGZsb3d
8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C
%7C%7C&sdata=CLP9vxL7Z6zLhfKWLHPoOmyWdRo9UwO5XysRxQsKemI%3D&reserved=0>



Could someone have an idea?

XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/293509> (by
email<>)

Current Thread