Retrieving XPath information on XML objects
You can use XPath syntax to locate an information in an XML document.
About this task
XPath is a standard means to locate a piece of information in an XML document. With some XML tools and libraries, you can use an XPath expression to locate, read, or set a value inside a complex document. Decision Server does not use XPath to locate information inside the document because it uses XML binding to map the document onto objects. However, after a rule has located a piece of information in the document, you might want to keep track of this location by using the XPath syntax so that you can reuse it in another tool.
For example, an XML document contains a list of financial transactions and you have built a ruleset to delete suspicious transactions. You can include the XPath value for these transactions. The calling application could then reuse these XPath locations to carry out further processing on the transactions by using other technologies that support XPath.
In Decision Server, the XPath expression is linked to IlrXmlObject when it is built from an XML document. With this expression, you can keep track of the original sub-tree of any XML object, although there is no feature to filter the IlrXmlObject tree by using an XPath expression.
XPath information is provided by the following methods:
IlrXmlObject.getRelativeXPath(boolean)
IlrXmlObject.getAbsoluteXPath(boolean)
These methods link the dynamic object to the original XML information location. This information is located when the IlrXmlDefaultDataDriver.readObject method is invoked.
In the following example, we assume that an instance
of IlrXmlObject has been created from the first <c> complex
element on an XML document.
Procedure
To get XPath information on an IlrXmlObject: