You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
michaelhkay opened this issue
Feb 6, 2025
· 2 comments
Labels
FeatureA change that introduces a new featureXPathAn issue related to XPathXQFOAn issue related to Functions and OperatorsXQueryAn issue related to XQuery
I propose that the parse-json function should create a pinned tree, so that upwards navigation to parent and ancestor j-nodes becomes possible.
I propose introducing the key specifier .., with $M?.. being a shorthand for ($M => label())?parent, giving a convenient and familiar way to navigate from a j-node to its parent in a pinned tree. For example, $M?..?name gives the value of the name property in the immediately containing map.
Similarly, I propose introducing the key specifier ... to navigate to ancestors, so $M?... becomes a shorthand for ($M => label())?ancestors(), and $M?...?name returns the name property of all containing maps.
For symmetry I suggest we also provide ... as an abbreviated axis step, short for ancestor::node().
I'd like to find a better name for "pinned". Perhaps "tracked" better captures that what it does is to track downward navigation steps and make them reversible.
I'd also like to introduce the terms j-tree and j-node. A j-tree is a map or array, recursively expanded to include its entries or members. A j-node is a value in a j-tree. Perhaps confine the usage to maps and arrays that have been pinned/tracked.
The text was updated successfully, but these errors were encountered:
The other label property that's very useful is the key property. `I can't immediately think of nice syntax for getting that. The fn:key() function, of course, is already taken in XSLT.
The .. syntax also gives the ability to detect that we're at the top of the tree using match=".[empty(?..)]" -- something that we observed was lacking in the case-study at #1786 .
FeatureA change that introduces a new featureXPathAn issue related to XPathXQFOAn issue related to Functions and OperatorsXQueryAn issue related to XQuery
I propose that the parse-json function should create a pinned tree, so that upwards navigation to parent and ancestor j-nodes becomes possible.
I propose introducing the key specifier
..
, with$M?..
being a shorthand for($M => label())?parent
, giving a convenient and familiar way to navigate from a j-node to its parent in a pinned tree. For example,$M?..?name
gives the value of thename
property in the immediately containing map.Similarly, I propose introducing the key specifier
...
to navigate to ancestors, so$M?...
becomes a shorthand for($M => label())?ancestors()
, and$M?...?name
returns thename
property of all containing maps.For symmetry I suggest we also provide
...
as an abbreviated axis step, short forancestor::node()
.I'd like to find a better name for "pinned". Perhaps "tracked" better captures that what it does is to track downward navigation steps and make them reversible.
I'd also like to introduce the terms
j-tree
andj-node
. A j-tree is a map or array, recursively expanded to include its entries or members. A j-node is a value in a j-tree. Perhaps confine the usage to maps and arrays that have been pinned/tracked.The text was updated successfully, but these errors were encountered: