Changes

Jump to navigation Jump to search
1,085 bytes added ,  22:36, 20 January 2017
added section on character mappings with small example from the mailing list
John;Newton
Jack;Oldtown
</pre>
 
=Character mappings=
 
Character maps allow a specific character in the instance of the data model to be replaced with a specified string of characters during serialization. The string that is substituted is output "as is," and the serializer performs no checks that the resulting document is well-formed. This may only occur in documents parsed with {{Code|parameter-document}}.
 
This example maps the Unicode U+00A0 NO-BREAK SPACE as &amp;#160; instead of the entity &amp;nbsp;.
 
'''Example query''':
<pre class="brush:xquery">
(: The output namespace declaration is optional, because it is statically declared in BaseX) :)
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:parameter-document "map.xml";
<x>&amp;#xA0;</x>
</pre>
 
'''Example parameter-document''':
<pre class="brush:xml">
<serialization-parameters
xmlns="http://www.w3.org/2010/xslt-xquery-serialization">
<use-character-maps>
<character-map character="&amp;#160;" map-string="&amp;amp;#160;"/>
</use-character-maps>
</serialization-parameters>
</pre>
administrator, editor
3

edits

Navigation menu