25.12.2013 Views

Tamino XQuery User Guide - Software AG Documentation

Tamino XQuery User Guide - Software AG Documentation

Tamino XQuery User Guide - Software AG Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Text Retrieval<br />

path separator is not defined as a regular character, it will be interpreted as a delimiter. Using the<br />

default settings, the pattern in function call tf:containsText($path, "*\\*") will thus be interpreted<br />

as if "* *" were used, since the escapecard character tries to mask an invalid character and<br />

the text retrieval system uses a delimiter instead. This would yield "true", since there are two occurrences<br />

of two adjacent words separated by a space character ("Program Files" and "<strong>Software</strong><br />

<strong>AG</strong>"). In cases like these you should ensure that the transliteration is appropriately defined according<br />

to what your application expects.<br />

Note: In contrast to "*", the characters "\" and "?" are normally not classified as regular<br />

characters in the collection ino:transliteration. See the section Customizing Transliterations<br />

for instructions how to customize this special collection.<br />

Customizing Special Character Settings<br />

If you use the default tokenizer (white space-separated), you can customize the settings for the<br />

special characters used in pattern matching. They are declared as attributes to ino:transliteration<br />

in the special collection ino:vocabulary:<br />

escapecard character<br />

maskcard character<br />

wildcard character<br />

ino:escapechar<br />

ino:maskchar<br />

ino:wildchar<br />

To change the value of any of these attributes, you can use a query similar to the following, which<br />

sets the value of the maskcard character to the default value:<br />

declare namespace ino="http://namespaces.softwareag.com/tamino/response2"<br />

update insert attribute ino:maskchar {"?"}<br />

into input()/ino:transliteration<br />

You can check your changes with the following query:<br />

declare namespace ino="http://namespaces.softwareag.com/tamino/response2"<br />

for $a in input()/ino:transliteration/@*<br />

return $a<br />

Note that only attributes that have been modified are returned.<br />

<strong>XQuery</strong> <strong>User</strong> <strong>Guide</strong><br />

103

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!