Changes

Jump to navigation Jump to search
No change in size ,  02:28, 13 March 2012
no edit summary
and [http://www.w3.org/TR/xpath-30/ XPath 3.0] Recommendations
that have already been implemented in BaseX.
 
==EQName: Expanded QNames==
 
{{Mark|Updated with Version 7.2:}}
 
A ''QName'' can now be directly prefixed with the letter "Q" and a namespace URI in the [http://www.jclark.com/xml/xmlns.htm Clark Notation].
 
'''Examples:'''
* <code><nowiki>Q{http://www.w3.org/2005/xpath-functions/math}pi()</nowiki></code> returns the number π
* <code>Q{java:java.io.FileOutputStream}new("output.txt")</code> creates a new Java file output stream
 
Before {{Mark|Version 7.2}}, and in older versions of the XQuery 3.0 specification, the prefixed namespace URI was quoted:
 
* <code><nowiki>"http://www.w3.org/2005/xpath-functions/math":pi()</nowiki></code>
* <code>"java:java.io.FileOutputStream":new("output")</code>
 
==Namespace Constructors==
 
New namespaces can now be created via so-called 'Computed Namespace Constructors'.
 
<pre class="brush:xquery">
element node { namespace pref { 'http://url.org/' } }
</pre>
 
==String Concatenations==
 
Two vertical bars <code>||</code> (also names ''pipe characters'') can be used to concatenate strings. This operator is a shortcut for the {{Mono|ft:contains()}} function.
 
<pre class="brush:xquery">
'Hello' || ' ' || 'Universe'
</pre>
 
==External Variables==
 
Default values can now be attached to external variable declarations. This way, an expression can also be evaluated if its external variables have not been bound to a new value.
 
<pre class="brush:xquery">
declare variable $user external := "admin";
"User:", $user
</pre>
==Group By==
Function items can also be passed as arguments to and returned as results from functions. These so-called [[Higher-Order Functions]] like <code>fn:map</code> and <code>fn:fold-left</code> are discussed in more depth on their own Wiki page.
 
==EQName: Expanded QNames==
 
{{Mark|Updated with Version 7.2:}}
 
A ''QName'' can now be directly prefixed with the letter "Q" and a namespace URI in the [http://www.jclark.com/xml/xmlns.htm Clark Notation].
 
'''Examples:'''
* <code><nowiki>Q{http://www.w3.org/2005/xpath-functions/math}pi()</nowiki></code> returns the number π
* <code>Q{java:java.io.FileOutputStream}new("output.txt")</code> creates a new Java file output stream
 
Before {{Mark|Version 7.2}}, and in older versions of the XQuery 3.0 specification, the prefixed namespace URI was quoted:
 
* <code><nowiki>"http://www.w3.org/2005/xpath-functions/math":pi()</nowiki></code>
* <code>"java:java.io.FileOutputStream":new("output")</code>
 
==Namespace Constructors==
 
New namespaces can now be created via so-called 'Computed Namespace Constructors'.
 
<pre class="brush:xquery">
element node { namespace pref { 'http://url.org/' } }
</pre>
 
==String Concatenations==
 
Two vertical bars <code>||</code> (also names ''pipe characters'') can be used to concatenate strings. This operator is a shortcut for the {{Mono|ft:contains()}} function.
 
<pre class="brush:xquery">
'Hello' || ' ' || 'Universe'
</pre>
 
==External Variables==
 
Default values can now be attached to external variable declarations. This way, an expression can also be evaluated if its external variables have not been bound to a new value.
 
<pre class="brush:xquery">
declare variable $user external := "admin";
"User:", $user
</pre>
==Serialization==
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu