Fundamentals > Windchill Search > Search Reference > XML Document Searches
  
XML Document Searches
* 
The following topic only applies when the wt.index.enableXMLTagSearch property is set to true. By default, this property is set to false.
If you have Windchill Index Search installed and enabled, XML files are indexed by default. You can search for XML documents using a standard keyword search against XML content (values between the XML tags).
However, if the wt.index.enableXMLTagSearch property is set to true, then Windchill indexes the XML content, tags, and attributes. As a result, all tag names and content in an XML document are indexed and searchable using the Keyword field.
For example, you upload an XML document that contains the following:
<title>Part Catalog</title>
A keyword search for either “catalog” or “title” returns the XML document.
To limit your keyword search to XML documents, you can enter xml: followed by a specialized query string.
* 
XML searches can only be performed in English. There is no language processing when performing XML-scoped indexing.
When invalid XML is present, Windchill cannot index the content of the XML document. In those situations, the XML document is only searchable by its Name and Number attributes.
Keyword rules apply when performing a specialized xml: search. For example, wildcards are allowed and stemming is used. For more information, see Keyword Search Rules.
To perform a specialized xml: search, your Search Mode preference must be set to Simple and the wt.index.enableXMLTagSearch property must be set to true.
XML Tag Search
You can search against tag names and tag content using the following formats:
xml:tag
xml:tag(content)
You can also combine these strings to search multiple levels of the XML hierarchy. When searching by hierarchy, the following rules apply:
You can search any number of levels deep.
Separate hierarchy levels with a colon character (“:”)
xml:tag(content):tag(content)
Strings within (content) are joined by an OR operator.
You do not need to specify a tag for every level in the hierarchy.
You can search for content even if there are intermediate tags within the hierarchy.
As long as the content is nested within a tag, you can include strings from anywhere within the hierarchy.
You must follow the hierarchical structure.
For example, you upload the following XML file:
You can use any of the following keyword searches to return the file:
xml:catalog
xml:cat*
xml:page
xml:spring(gloves)
xml:spring(outdoor):page(soil gloves)
xml:catalog:spring
xml:catalog:spring:title(sales)
xml:catalog(garden tools soil winter)
catalog garden tools soil winter
However, the following searches fail:
Keyword
Reason for Failure
xml:garden
You cannot search by content alone. The content must be enclosed in parentheses and follow a tag name.
If you do not want to include a tag in your search, remove the xml: modifier and perform a basic keyword search.
Workaround:
xml:spring(garden)
xml:spring:title(garden)
garden
xml:catalog(garden)item(gloves)
You must use a colon between hierarchical levels.
Workaround:
xml:catalog(garden):item(gloves)
xml:caption(winter):catalog(sales)
xml:caption(sales)
Hierarchical searches must begin at a higher level followed by nested levels. You cannot begin with a nested tag followed by a higher-level tag.
The CAPTION tag is nested within CATALOG.
“Sales” is higher in the tag hierarchy than CAPTION.
<CATALOG>
<SPRING>
<TITLE>Garden Sales</TITLE>
<PAGE>
<CAPTION>Goodbye, Winter!</ITEM>

Workaround:
xml:catalog(sales):caption(winter)
xml:catalog(sales winter)
xml:catalog(sales winter):caption
xml:catalog:caption(winter)
xml:title(potting soil)
If you pair a tag name and content that is not directly within the tag, then the content must be nested within the specified tag.
In the example XML, “potting soil” is the content of a nested ITEM tag. The TITLE tag is at a higher level in the hierarchy. However, TITLE is not part of the tag hierarchy for ITEM.
The ITEM tag hierarchy is CATALOG > SPRING > PAGE > ITEM:
<CATALOG>
<SPRING>
<TITLE>Garden Sales</TITLE>
<PAGE>
<ITEM>Potting Soil</ITEM>

Workaround:
xml:page(potting soil)
xml:catalog(potting soil)
xml:catalog:page(potting soil)
xml:catalog:spring:page:item(potting soil)
xml:caption(winter):item(soil)
You cannot search for two tags that are on the same hierarchical level:
<PAGE>
<CAPTION>Goodbye, Winter!</CAPTION>
<ITEM>Potting Soil</ITEM>

Workaround:
xml:page(winter):item(soil)
xml:page(winter soil)
xml:caption(winter)
xml:item(soil)
XML Attribute Search
You can search against attribute names and attribute values using the following formats:
xml:@attribute
xml:@attribute(value)
* 
You cannot combine different attribute names with values. The value must belong to the attribute.
You can also combine these strings to search multiple levels of the XML hierarchy. When searching by hierarchy, the following rules apply:
You can search any number of levels deep.
Separate hierarchy levels with a colon character (“:”)
xml:@attribute(value):@attribute(value)
Strings within (value) are joined by an OR operator.
You do not need to specify an attribute for every level in the hierarchy.
You must follow the hierarchical structure.
For example, you upload the following XML file:
You can use any of the following keyword searches to return the file:
xml:@month
xml:@month(ma*)
xml:@color(pink)
xml:@number:@color
xml:@status(released):@number:@id(98821c56)
march color pink 98821c56
However, the following searches would fail:
xml:pink
You cannot search by value alone. The value must be enclosed in parentheses and follow an attribute.
If you do not want to include an attribute in your search, remove the xml: modifier and perform a basic keyword search.
Workaround:
xml:@color(pink)
xml:@month:@color(pink)
pink
xml:@month(march april)@color(pink)
You must use a colon between hierarchical levels.
Workaround:
xml:@month(march april):@color(pink)
xml:@status(98821c56)
Unlike tag and content pairs, you cannot search for a nested value.
In other words, you cannot mix and match attribute names with nested attribute values.
<CATALOG status="Released">
<SPRING month="March, April, May">
<PAGE number="12">
<ITEM id="98821c56">Potting Soil</ITEM>

Workaround:
xml:@status:@id(98821c56)
xml:@id(98821c56)
xml:@number(12):@status(released)
Hierarchical searches must begin at a higher level followed by nested levels. You cannot begin with a nested attribute and then search for an attribute or value higher in the hierarchy.
<CATALOG status="Released">
<SPRING month="March, April, May">
<PAGE number="12">

Workaround:
xml:@status(released):@number(12)
xml:@status(released):@number
xml:@status:@number(12)
xml:@alias(garden):@number(12)
You cannot search for two attributes within different tags on the same hierarchical level:
<CATALOG status="Released">
<SPRING month="March, April, May">
<TITLE alias="Spring Garden Catalog">Garden Sales</TITLE>
<LINE>Outdoor_Tools</LINE>
<PAGE number="12">

Workaround:
xml:@alias(garden)
xml:@number(12)
Combined Tag and Attribute Searches
You can combine the searches above to search by XML tag, content, attribute, and attribute value.
You can use any of the following formats:
xml:tag(content)@attribute(value)
xml:tag@attribute
xml:tag(content)@attribute
xml:tag@attribute(value)
You can use the colon character (:) to traverse the XML hierarchy. Hierarchical searches must follow the same rules outlined above.
For example, you upload the following XML file:
You can use any of the following keyword searches to return the file:
xml:spring@month(april)
xml:catalog(garden soil gloves)@status(released)
xml:page@number(12):item@id(98821c56)
xml:catalog:@month(april):caption(goodbye)
xml:catalog(gloves soil):page@number(12):caption(goodbye)
xml:spring(garden tools):@alias
catalog march spring pink 98821c56
However, the following searches would fail:
xml:item(pink)
You cannot pair a tag name with an attribute value.
Workaround:
xml:item@color(pink)
item pink
xml:@id(potting soil)
You cannot pair an attribute name with tag content.
Workaround:
xml:item(potting soil)@id
id potting soil
xml:spring@color(pink)
You cannot pair a tag name with an attribute that is specified on a different tag.
Workaround:
xml:item@color(pink)
xml:spring:@color(pink)
xml:spring:@status(released)
Hierarchical searches must begin at a higher level followed by nested levels. You cannot begin with a nested attribute or tag and then specify an element higher in the hierarchy.
Workaround:
xml:@status(released):spring