Subject: Re: [xsl] matches() method in XPath 1.0 From: "Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 31 Jan 2023 00:25:06 -0000 |
Manuel. XPath 1.0 is pretty limited, but you might be able to accomplish your goal with something like substring-before($filename,$suffix) and not(substring-after($filename,$suffix)) There is no ends-with() in XPath 1.0, regrettably, so one has to concoct one. But I'm not sure about how to do this with many values at once other than a string of 'or' clauses.... Good luck, Wendell From: Manuel Souto Pico terminolator@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Monday, January 30, 2023 6:31 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] matches() method in XPath 1.0 Dear all, 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.0 https://www.w3.org/TR/its20/#d0e2513<https://gcc02.safelinks.protection.outlo ok.com/?url=https%3A%2F%2Fwww.w3.org%2FTR%2Fits20%2F%23d0e2513&data=05%7C01%7 Cwendell.piez%40nist.gov%7Cda7e1721fe1448af3f5b08db031a094c%7C2ab5d82fd8fa479 7a93e054655c61dec%7C1%7C0%7C638107182586769916%7CUnknown%7CTWFpbGZsb3d8eyJWIj oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C& sdata=45TruVFABy3KR5YqhXSXLE5qV8y9FoKgQh04QDix6rY%3D&reserved=0> Could someone have an idea? Thank you so much. Cheers, Manuel PS: Apologies if questions about XPath are not appropriate in this list, please let me know if that's the case. XSL-List info and archive<https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww. mulberrytech.com%2Fxsl%2Fxsl-list&data=05%7C01%7Cwendell.piez%40nist.gov%7Cda 7e1721fe1448af3f5b08db031a094c%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C6 38107182586769916%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CS3VUqyBl%2F88KklhVF5Aq I66OJfeM0EOMjtgeze7N5k%3D&reserved=0> EasyUnsubscribe<https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2 F%2Flists.mulberrytech.com%2Funsub%2Fxsl-list%2F3302254&data=05%7C01%7Cwendel l.piez%40nist.gov%7Cda7e1721fe1448af3f5b08db031a094c%7C2ab5d82fd8fa4797a93e05 4655c61dec%7C1%7C0%7C638107182586769916%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=v SvT154QEEmbrZk78E16E98yQlQeAMQcO%2BBdo7gT0R8%3D&reserved=0> (by email<>)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] matches() method in XPath 1.0, Manuel Souto Pico te | Thread | Re: [xsl] matches() method in XPath, Bauman, Syd s.bauman |
[xsl] matches() method in XPath 1.0, Manuel Souto Pico te | Date | Re: [xsl] matches() method in XPath, Bauman, Syd s.bauman |
Month |