Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1183 Add transient mode and the transient{} expression #1209

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions specifications/grammar-40/xpath-grammar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,7 @@ ErrorVal ::= "$" VarName
<g:ref name="FunctionCall" lookahead="2"/>
<g:ref name="OrderedExpr" if=" xquery40" lookahead="2"/>
<g:ref name="UnorderedExpr" if=" xquery40" lookahead="2"/>
<g:ref name="TransientExpr" if=" xpath40 xquery40" lookahead="2"/>
<g:ref name="NodeConstructor" if="xquery40" lookahead="2"/>
<g:ref name="FunctionItemExpr" if="xpath40 xquery40 xslt40-patterns"/>
<g:ref name="MapConstructor" if="xpath40 xquery40"/>
Expand Down Expand Up @@ -2219,6 +2220,14 @@ ErrorVal ::= "$" VarName
<g:ref name="Rbrace" not-if="xquery40"/>
<g:ref name="EnclosedExpr" if="xquery40"/>
</g:production>

<g:production name="TransientExpr" if=" xpath40 xquery40">
<g:string>transient</g:string>
<g:ref name="Lbrace" not-if="xquery40"/>
<g:ref name="Expr" not-if="xquery40"/>
<g:ref name="Rbrace" not-if="xquery40"/>
<g:ref name="EnclosedExpr" if="xquery40"/>
</g:production>

<g:production name="FunctionCall" comment-id="parens" xgc-id="reserved-function-names">
<g:ref name="_Function_QName_or_EQName" unfold="yes"/>
Expand Down
11 changes: 11 additions & 0 deletions specifications/xpath-functions-40/src/xpath-functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,12 @@ This includes all the built-in datatypes defined in <bibref ref="xmlschema-2"/>.
<div3 id="properties-of-functions">
<head>Properties of functions</head>

<changes>
<change issue="1183" PR="1209" date="2024-05-13">
The determinism or nondeterminism of functions is affected by the
new <code>transient</code> expression.</change>
</changes>

<p>This section is concerned with the question of whether two calls on a function, with the same arguments, may
produce different results.</p>

Expand Down Expand Up @@ -1176,6 +1182,11 @@ This includes all the built-in datatypes defined in <bibref ref="xmlschema-2"/>.
in the function call can be sequence-concatenated to supply the value of a single parameter
in the function definition.</termdef></p>

<p>A <xnt spec="XP40" ref="TransientExpr">Transient Expression</xnt> may be used to relax the
determinism requirement on expressions that occur within its scope. For example,
the expression <code>transient{ current-dateTime() }</code> may deliver different results
each time it is called. For details see <xspecref spec="XP40" ref="id-transient-expressions"/>.</p>

</div3>
</div2>
</div1>
Expand Down
Loading
Loading