|
Page Edited :
ODExSITE :
XPath Extensions
XPath Extensions has been edited by Alexis Midon (Oct 02, 2008). Content:Apache ODE extends the default XPath coverage provided by the WS-BPEL XPath 2.0To use XPath 2.0 in your processes just use the following queryLanguage and expressionLanguage attributes: queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
insert-beforeThis is a function that allows you to insert one or more siblings (specified by the $siblings argument in the signature below) before the first node of children (specified by the $children argument), all of whose nodes must have the same parent (specified by the $context argument). Insert Before ode:insert-before($context as node(), $children as node()*, $siblings as node()*) as node() By design, this function is non-updating in that it preserves the identity and properties of its arguments (i.e., they don't try to change the XML in-place). Instead, a modified copy of the context node is created, essentially giving it a new identity. Further, it returns a single R-value item, as opposed to a sequence. The example below illustrates how it may be used in the context of an assign activity: <assign> <copy> <from>ode:insert-before($parent, $parent/child::node[position()=last()], $siblings)</from> <to variable="parent"/> </copy> </assign> For those familiar with the XQuery Update Facility XQuery Equivalent insert nodes $siblings before $parent/child::node[position()=last()] insert-afterThis is a function that allows you to insert one or more siblings (specified by the $siblings argument in the signature below) after the last node of children (specified by the $children argument), all of whose nodes must have the same parent (specified by the $context argument). Insert After ode:insert-after($context as node(), $children as node()*, $siblings as node()*) as node() By design, this function is non-updating in that it preserves the identity and properties of its arguments (i.e., they don't try to change the XML in-place). Instead, a modified copy of the context node is created, essentially giving it a new identity. Further, it returns a single R-value item, as opposed to a sequence. The example below illustrates how it may be used in the context of an assign activity: <assign> <copy> <from>ode:insert-after($parent, $parent/child::node(), $siblings)</from> <to variable="parent"/> </copy> </assign> For those familiar with the XQuery Update Facility XQuery Equivalent insert nodes $siblings after $parent/child::node() insert-as-first-intoThis is a function that allows you to insert the node(s) (specified by the $children argument in the signature below) as the first child(ren) of a given context node (specified by the $context argument). Insert As First Into ode:insert-as-first-into($context as node(), $children as node()*) as node() By design, this function is non-updating in that it preserves the identity and properties of its arguments (i.e., they don't try to change the XML in-place). Instead, a modified copy of the context node is created, essentially giving it a new identity. Further, it returns a single R-value item, as opposed to a sequence. The example below illustrates how it may be used in the context of an assign activity: <assign> <copy> <from>ode:insert-as-first-into($parent, $children)</from> <to variable="parent"/> </copy> </assign> For those familiar with the XQuery Update Facility XQuery Equivalent insert nodes $children as first into $parent insert-as-last-intoThis is a function that allows you to insert the node(s) (specified by the $children argument in the signature below) as the last child(ren) of a given context node (specified by the $context argument). Insert As Last Into ode:insert-as-last-into($context as node(), $children as node()*) as node() By design, this function is non-updating in that it preserves the identity and properties of its arguments (i.e., they don't try to change the XML in-place). Instead, a modified copy of the context node is created, essentially giving it a new identity. Further, it returns a single R-value item, as opposed to a sequence. The example below illustrates how it may be used in the context of an assign activity: <assign> <copy> <from>ode:insert-as-last-into($parent, $children)</from> <to variable="parent"/> </copy> </assign> For those familiar with the XQuery Update Facility XQuery Equivalent insert nodes $children as last into $parent deleteThis is a function that allows you to delete one or more node(s) (specified by the $children argument in the signature below) from its parent (specified by the $context argument). Delete ode:delete($context as node(), $children as node()*) as node() By design, this function is non-updating in that it preserves the identity and properties of its arguments (i.e., they don't try to change the XML in-place). Instead, a modified copy of the context node is created, essentially giving it a new identity. Further, it returns a single R-value item, as opposed to a sequence. The example below illustrates how it may be used in the context of an assign activity: <assign> <copy> <from>ode:delete($parent, $children)</from> <to variable="parent"/> </copy> </assign> For those familiar with the XQuery Update Facility XQuery Equivalent delete nodes $children renameThis is a function that allows you to rename the context node (specified by the $context argument in the signature below) as per the given name (specified by $item, which is either a QName, Element or String). Rename ode:rename($context as node(), $name as item()) as node() By design, this function is non-updating in that it preserves the identity and properties of its arguments (i.e., they don't try to change the XML in-place). Instead, a modified copy of the context node is created, essentially giving it a new identity. Further, it returns a single R-value item, as opposed to a sequence. The example below illustrates how it may be used in the context of an assign activity: <assign> <copy> <from>ode:rename($person, fn:QName("http://www.example.com/example", "manager"))</from> <to variable="person"/> </copy> </assign> For those familiar with the XQuery Update Facility XQuery Equivalent rename $person as fn:QName("http://www.example.com/example", "manager")
combine-url(base, relative)Takes the relative URL and combines it with the base URL to return a new absolute URL. If the relative parameter is an absolute URL, returns it instead. compose-url(template, [name, value]*)compose-url(template, pairs)Expands the template URL by substituting place holders in the template, for example, ('/order/{id}', 'id', 5) returns '/order/5'. Substitute values are either name/value pairs passed as separate parameters, or a node-set returning elements with name mapping to value. The functions applies proper encoding to the mapped values. Undefined variables are replaced with an empty string. This function returns an URL. expand-template(template, [name, value]*)expand-template(template, pairs)Similar to composeURL but undefined variables are not replaced with an empty string. They are ignored. As a result with incomplete mapping may return a new URL template. |
Unsubscribe or edit your notifications preferences
