Changes

Jump to navigation Jump to search
1,130 bytes added ,  14:48, 9 May 2012
Added section on searching mixed content
"foo" and the text node "foo bar", and one error between
"foo" and "foa bar".
 
==Mixed Content==
 
When working with so-called narrative XML documents, such as HTML, TEI, or DocBook documents, you typically have mixed content, i.e., a mix of text and markup, such as:
 
<pre class="brush:xml">
<p>This is only an illustrative <hi>example</hi>, not a <q>real</q> text.</p>
</pre>
 
Here you typically want to search across elements, so that the above paragraph would match a search for <code>real text</code>. For more examples, see [http://www.w3.org/TR/xpath-full-text-10-use-cases/#Across XQuery and XPath Full Text 1.0 Use Cases].
 
To enable this kind of searches, ''whitespace chopping'' must be turned off by setting the option <code><[[Options#CHOP|CHOP]]/code> to <code>OFF</code> (default: <code>SET CHOP ON</code>). In the GUI, you find this option in Database → New… → Parsing → Chop Whitespaces.
 
A query such as <code>//p[. contains text 'real text']</code> will then match the example paragraph above.
 
Note that the <code>ft:mark</code> and <code>ft:extract</code> functions (see [[Full-Text Module|Full-Text Functions]]) only work if the addressed elements have no descendant elements.
==Functions==
editor, reviewer
10

edits

Navigation menu