oasis-tcs / xacml-spec

OASIS XACML TC: List for tracking issues and features for the OASIS XACML TC. https://github.com/oasis-tcs/xacml-spec
Other
4 stars 0 forks source link

Support newer XPath versions (3.0, 3.1) #29

Open cdanger opened 2 months ago

cdanger commented 2 months ago

XACML 3.0 only supports XPath 1.0 and 2.0 (which is over 10 years old). This is a enhancement proposal to support XPath 3.0 and/or latest 3.1.

The new features in XPath 3.0 / 3.1 are well summarized in Saxonica's documentation. Just to give a few:

EDIT: One of the great features of XPath 3.1 is JSON processing and support of JSONPath-like evaluation. See this example based on Altova's documentation using the new parse-json function and lookup operator:

let $x := parse-json(.) return $x?employees?employee?age

This XPath expression applied to the string (JSON object) '{"employees" : {"employee" : {"id": 1, "name": "Chris", "age": 41}}}' for example will return 41.

In this example the 'parse-json' function returns a map which contains nested maps. The 'lookup' operator is used numerous times to access the associated values of keys in the nested maps i.e. ?employees?employee?age

steven-legg commented 2 months ago

It makes sense to support the latest available version. Support for XPath is optional so including 3.0/3.1 doesn't impose a burden on implementators who ignore XPath.

There is a section in the core spec that discusses the implementation-defined aspects of XPath 2.0. We should also cover XPath 3.0/3.1.

cdanger commented 2 months ago

I added a paragraph to my original comment on JSON processing capabilities introduced in XPath 3.1, which allows to mimic JSONPath (#5 ) evaluation with XPath syntax!

cdanger commented 2 months ago

Should we also deprecate XPath 1.0?

humantypo commented 2 months ago

25 years seems like a good run so that makes sense to me. Given that XPath 3.1 has been around for 7 years is it reasonable to ask the same thing about XPath 2.0 in v4?

cdanger commented 1 month ago

Well, XPath 2.0 was last updated in 2016 and still widely used as far as I know, so I would not throw it away just yet. Also last time I checked there are not so many XPath 3.x implementations out there. Sure we have at least one in Java, so no problem there, but other developers in other programming languages might not be so lucky. What's your experience?

humantypo commented 1 month ago

My experience is that everything in my world has moved to JSON :)

I did some poking around and it looks like XPath 2 is still very much in use...to the point that it seems pretty clear there isn't a lot of interest in XPath these days.

cdanger commented 1 month ago

Indeed, it's time to move that to a separate xacml profile #33 so that the JSON fan base doesn't have to deal with that in the core spec :stuck_out_tongue_winking_eye: . see #33