Skip to content

Commit

Permalink
Add -or-self axes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhkay committed Oct 25, 2024
1 parent 75f1197 commit 4c9bc31
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
5 changes: 4 additions & 1 deletion specifications/grammar-40/xpath-grammar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,9 @@ ErrorVal ::= "$" VarName
<g:string process-value="yes">descendant</g:string>
<g:string process-value="yes">descendant-or-self</g:string>
<g:string process-value="yes">following</g:string>
<g:string process-value="yes">following-or-self</g:string>
<g:string process-value="yes">following-sibling</g:string>
<g:string process-value="yes">following-sibling-or-self</g:string>
<g:string process-value="yes" if="xpath40 xslt40-patterns">namespace</g:string>
<g:string process-value="yes">self</g:string>
</g:choice>
Expand Down Expand Up @@ -1920,7 +1922,8 @@ ErrorVal ::= "$" VarName
<g:string process-value="yes">ancestor-or-self</g:string>
<g:string process-value="yes">parent</g:string>
<g:string process-value="yes">preceding</g:string>
<g:string process-value="yes">preceding-sibling</g:string>
<g:string process-value="yes">preceding-or-self</g:string>
<g:string process-value="yes">preceding-sibling-or-self</g:string>
</g:choice>
<g:string>::</g:string>
</g:production>
Expand Down
36 changes: 32 additions & 4 deletions specifications/xquery-40/src/expressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11168,6 +11168,12 @@ return if (every $r in $R satisfies $r instance of node())

<div4 id="axes">
<head>Axes</head>
<changes>
<change issue="1519">
Four new axes have been defined: <code>preceding-or-self</code>, <code>preceding-sibling-or-self</code>,
<code>following-or-self</code>, and <code>following-sibling-or-self</code>.
</change>
</changes>
<scrap>
<head/>
<prodrecap id="ForwardAxis" ref="ForwardAxis"/>
Expand All @@ -11178,7 +11184,7 @@ return if (every $r in $R satisfies $r instance of node())


<p role="xpath"
>XPath defines a full set of <term>axes</term>
>XPath defines a set of <term>axes</term>
for traversing documents, but a <term>host language</term> may define a subset
of these axes. The following axes are defined:</p>

Expand Down Expand Up @@ -11298,6 +11304,11 @@ return if (every $r in $R satisfies $r instance of node())
<code>following-sibling</code> axis is
empty.</p>
</item>

<item>
<p>The <code>following-sibling-or-self</code> axis contains the context node,
together with the contents of the <code>following-sibling</code> axis.</p>
</item>



Expand All @@ -11315,6 +11326,11 @@ return if (every $r in $R satisfies $r instance of node())
<code>preceding-sibling</code> axis is
empty.</p>
</item>

<item>
<p>The <code>preceding-sibling-or-self</code> axis contains the context node,
together with the contents of the <code>preceding-sibling</code> axis.</p>
</item>



Expand All @@ -11332,7 +11348,10 @@ return if (every $r in $R satisfies $r instance of node())

</item>


<item>
<p>The <code>following-or-self</code> axis contains the context node,
together with the contents of the <code>following</code> axis.</p>
</item>

<item>

Expand All @@ -11348,7 +11367,10 @@ return if (every $r in $R satisfies $r instance of node())

</item>


<item>
<p>The <code>preceding-or-self</code> axis contains the context node,
together with the contents of the <code>preceding</code> axis.</p>
</item>

<item>
<p>The <code>attribute</code> axis
Expand Down Expand Up @@ -11437,7 +11459,13 @@ return if (every $r in $R satisfies $r instance of node())
axis that only ever contains the context node or nodes that are before the
context node in <termref
def="dt-document-order">document order</termref> is a reverse axis.</p>
<p>The <code>parent</code>, <code>ancestor</code>, <code>ancestor-or-self</code>, <code>preceding</code>, and <code>preceding-sibling</code> axes are reverse axes; all other axes are forward axes. The <code>ancestor</code>, <code>descendant</code>, <code>following</code>, <code>preceding</code> and <code>self</code> axes partition a document (ignoring attribute <phrase
<p>The <code>parent</code>, <code>ancestor</code>, <code>ancestor-or-self</code>,
<code>preceding</code>, <code>preceding-or-self</code>,
<code>preceding-sibling</code>, and <code>preceding-sibling-or-self</code> axes
are reverse axes; all other axes are forward axes.</p>

<p>The <code>ancestor</code>, <code>descendant</code>,
<code>following</code>, <code>preceding</code> and <code>self</code> axes partition a document (ignoring attribute <phrase
role="xpath"
>and namespace</phrase> nodes):
they do not overlap and together they contain all the nodes in the
Expand Down

0 comments on commit 4c9bc31

Please sign in to comment.