XML Schema for No-Location, User-defined Indexing Procedure
This section describes additional constraints imposed on the XML document returned by the user-defined lexer indexing procedure when the third parameter is FALSE. The XML document returned must be valid with respect to the following XML Schema:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="tokens">
<xsd:complexType>
<xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="eos" type="EmptyTokenType"/>
<xsd:element name="eop" type="EmptyTokenType"/>
<xsd:element name="num" type="xsd:token"/>
<xsd:group ref="IndexCompositeGroup"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!--
Enforce constraint that compMem element must be preceded by word element
or compMem element for indexing
-->
<xsd:group name="IndexCompositeGroup">
<xsd:sequence>
<xsd:element name="word" type="xsd:token"/>
<xsd:element name="compMem" type="xsd:token" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:group>
<!-- EmptyTokenType defines an empty element without attributes -->
<xsd:complexType name="EmptyTokenType"/>
</xsd:schema>
Here are some of the constraints imposed by this XML Schema:
-
The root element is tokens. This is mandatory. It has no attributes.
-
The root element can have zero or more child elements. The child elements can be one of the following elements: eos, eop, num, word, and
compMem. Each of these represent a specific type of token. -
The
compMemelement must be preceded by a word element or acompMemelement. -
The eos and eop elements have no attributes and must be empty elements.
-
The num, word, and
compMemelements have no attributes. Oracle Text will normalize the content of these elements as follows: convert whitespace characters to space characters, collapse adjacent space characters to a single space character, remove leading and trailing spaces, perform entity reference replacement, and truncate to 255 bytes.
Table 2-33 describes the element names defined in the preceding XML Schema.
Table 33 User-defined Lexer Indexing Procedure XML Schema Element Names
| Element | Description |
|---|---|
| word | This element represents a simple word token. The content of the element is the word itself. Oracle Text does the work of identifying this token as being a stop word or non-stop word and processing it appropriately. |
| num | This element represents an arithmetic number token. The content of the element is the arithmetic number itself. Oracle Text treats this token as a stop word if the stoplist preference has Supporting this token type is optional. Without support for this token type, adding the |
| eos | This element represents end-of-sentence token. Oracle Text uses this information so that it can support Supporting this token type is optional. Without support for this token type, queries against the |
| eop | This element represents end-of-paragraph token. Oracle Text uses this information so that it can support Supporting this token type is optional. Without support for this token type, queries against the |
| compMem | Same as the word element, except that the implicit word offset is the same as the previous word token. Support for this token type is optional. |
Examples
Document: Vom Nordhauptbahnhof und aus der Innenstadt zum Messegelände.
Tokens:
<tokens>
<word> VOM </word>
<word> NORDHAUPTBAHNHOF </word>
<compMem>NORD</compMem>
<compMem>HAUPT </compMem>
<compMem>BAHNHOF </compMem>
<compMem>HAUPTBAHNHOF </compMem>
<word> UND </word>
<word> AUS </word>
<word> DER </word>
<word> INNENSTADT </word>
<word> ZUM </word>
<word> MESSEGELÄNDE </word>
<eos/>
</tokens>
Document: Oracle Database 11g Release 1
Tokens:
<tokens>
<word> ORACLE11G</word>
<word> RELEASE </word>
<num> 1 </num>
</tokens>
Document: WHERE salary<25000.00 AND job = ‘F&B Manager’
Tokens:
<tokens>
<word> WHERE </word>
<word> salary<2500.00 </word>
<word> AND </word>
<word> job </word>
<word> F&B </word>
<word> Manager </word>
</tokens>