| ILOG JRules User Guide > Integrating Application Data > Tasks > Using the XML Binding API > Configuring XML Binding > Getting XPath Information on an IlrXmlObject |
Getting XPath Information on an IlrXmlObject |
PREVIOUS NEXT |
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. JRules does not use XPath to locate information inside the document, as it uses XML binding to map the document onto objects. However, once a rule has located a piece of information in the document, you may want to keep track of this location using the XPath syntax so that you can re-use 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, using other technologies that support XPath.
In JRules, 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 using an XPath expression.
XPath information is provided by the following methods:
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.
To get XPath information on an IlrXmlObject:
A is the mapping type of the <a> XML structure:
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |