![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
For a complete description of XPath, refer to the XPath specification (which can be obtained from www.w3.org).To reference a particular data item in a schema, you start with the root node and then use slashes (/) to indicate a path to the desired data element. For example, if you wish to specify the Street attribute in the ShipName complex element that is in the GetOrderInformation node, you would use the following syntax:XPath also has a method for referencing relative paths from a particular node. If you have an evaluation context, or a particular starting node in a schema tree, you can specify the relative path to other elements in the tree.For example, if your evaluation context is $GetOrderInformation/ShipName, then you can reference the sub-items of ShipName without specifying the entire path. If you wish to reference $GetOrderInformation/RequiredDate, the relative path would be ../RequiredDate. The path is relative to the evaluation context — RequiredDate is one level higher in the schema tree than the elements of ShipName.An XPath expression can have a search predicate. The search predicate is used to locate a specific element of a repeating schema item. For example, a $GetOrderInformation/OrderDetails/OrderItem item is a repeating element. If you wish to select only the first item in the repeating element, you would specify the following:Sub-items can also be examined and used in a search predicate. For example, to select the element whose ProductId is equal to "3A54", you would specify the following:Some elements can be explicitly set to nil. You can test an element to determine if it is set to nil or not. For example, the following XPath expression returns true if the $Order/Item/OnSale element is set to nil:{-- <comment here> --}
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |