0

I am working in PHP and using SimpleXML and XPath.
Is there a way to find which version of XPath is included with SimpleXML/PHP?

Also, is the version of XPath used with SimpleXML the "full version" with all of the features as a "non-SimpleXML" version (in particular "fn:sort")?

Thanks for input and leads.

2
  • 1
    PHP does not support XPath 2.0: stackoverflow.com/questions/28142859/evaluate-xpath-2-0-in-php Commented Aug 18, 2024 at 6:46
  • Generally, if the documentation just says "XPath" then it's a reasonable assumption that it's XPath 1.0, because both the software and documentation were written when that was the only version in town. But it's easy to check, e.g. by trying a function like current-date(). If you want a later version, you'll need a third-party library such as (my company's product) SaxonC. Commented Aug 18, 2024 at 10:53

1 Answer 1

0

As stated in the docs, SimpleXML requires libxml

This extension requires the libxml PHP extension

and according to libxml homepage, XPATH 1.0 is the implemented version

XML Path Language (XPath) 1.0: https://www.w3.org/TR/xpath

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.