Specifying the Namespace Mapping
If an XML document uses namespaces, the elements in that document might be prefixed with a string. When you create XQL queries to identify elements within the document, the XQL queries must include the prefix. If XML documents use equivalent namespaces but have different prefixes, you must define namespace mappings for Trading Networks to correctly locate the nodes identified by the XQL queries. Namespace mappings identify all prefixes that identify the same namespace (that is, point to the same URI).
Include a namespace mapping for each prefix/URI combination that you expect to receive in XML documents from your trading partners. If Trading Networks receives a document that uses a prefix that is not defined in the namespace mappings table, it performs a literal match of the XQL queries against the document.
If you are using a sample document, you can have Trading Networks populate the namespace mappings table with the prefix and URIs from the xmlns attributes that define namespaces in the sample document. If you are not using a sample document, you can define namespace mappings manually.
Trading Networks uses the literal string prefix0 to identify the default namespace. To define a mapping for the default namespace, which does not use a prefix, use the literal string prefix0 for the prefix. Do not use prefix0 as the prefix in any document.
To create the namespace mapping
1. Click the Namespaces tab.
2. Do one of the following:
![*](bullet.gif)
If you are using a sample document, click
More Actions next to the
Query field and click
Append Namespace Mapping.
Note: | If you need to replace existing namespace mappings, use Set Namespace Mapping. |
![*](bullet.gif)
If you are not using a sample document, do the following:
i. Click Add in the right panel.
ii. In the Prefix field, type the prefix for the namespace. If the mapping is for the default namespace, specify prefix0.
iii. In the URI field, type the URI for the namespace.
3. Click OK.