Changes

Jump to navigation Jump to search
432 bytes added ,  18:56, 9 August 2018
==Database Pragmas==
A All [[Options|local database optionoptions]] can also be assigned locally via a pragmapragmas. ExamplesSome examples:
* Whitespace chopping is disabled Enforce query to be rewritten for a particular document (see {{Option|CHOP}}): <pre class="brush:xquery">(# db:chop false #) { doc('docindex access. This can e.xml') }</pre> * {{Version|9 g.0}}: Enforce index rewriting be helpful if the name of a database name is not static (see [[Indexes#Enforce Rewritings|Enforce Rewritings]] for more examples):
<pre class="brush:xquery">
</pre>
* {{Version|9.0}}: Temporarily disable node copying in node constructors (see {{Option|COPYNODE}} for more details). The following query will be evaluated faster, and take much less memory, than without pragma, because the database nodes will not be fully copied, but only attached to the new {{Code|xml}} parent element:
<pre class="brush:xquery">
The annotation ensures that an error will only be thrown if the condition yields true. Without the annotation, the error will always be raised, because the referenced document is not found.
 
=Functions=
 
==Regular expressions==
 
{{Mark|Introduced with Version 9.1:}}
 
In analogy with Saxon, you can specify the flag {{Code|j}} to revert to Java’s default regex parser. For example, this allows you to use the word boundary option {{Code\b}}, which has not been included in the XQuery grammar for regular expressions:
 
'''Example:'''
<pre class="brush:xquery">
(: yields "!Hi! !there!" :)
fn:replace('Hi there', '\b', '!', 'j')
</pre>
=Serialization=
Various other extensions are described in the articles on [[Full-Text#BaseX Features|XQuery Full Text]] and [[Updates|XQuery Update]].
 
=Changelog=
 
# Version 9.1:
 
* Added: [[#Regular expressions]], {{Code|j}} flag for using Java’s default regex parser.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu