[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [wsbpel] Issue - 11 XPath function summary
As promised a summary of a proposal for new XPath functions for solving issue 11. Proposal for Issue 11: Currently an Assign Copy operation has the restriction that a <to> clause which uses a variable/part and query must return exactly one node. If it doesn't then a fault is thrown. This means that <copy> in its current form can only be used to update detailed information contained in a message part. To address this issue as well as the tight schedule of the wsbpel TC the following proposal for new XPath functions are proposed. The current specification specifies three mandatory XPath functions which engines must implement to allow access to process information. The following two new functions would be added to address new node creation within a <copy> operation. These functions can have some restrictions in particular they can only be used within a <to> query attribute. bpws:appendNode("childXPath" [, "parentXPath"] [, "siblingXPath"]) bpws:insertNode("childXPath" [, "parentXPath"] [, "siblingXPath"]) childXPath: The path of the child to be created, which must use the abbreviated form of XPath (e.g. a/b[2]/c). Note that we could place other limitations on this path as well. parentXPath: An XPath expression which evaluates, which must evaluate to exactly one node. It is optional and if not present then the context of the <to> variable part will be used for the requested node creation. siblingXPath: An XPath expression which evaluates, which must evaluate to exactly one node. It is executed within the context of the the parent query's result. It is optional and when present it provides a pivot point for the new node creation. If it is not present then an insert opertaion create a new node as the first child and an append will create a new node as the last child. These functions when called will create a new node at the requested location and return the node. This will ensure that the query returns exactly one node. Given the following starting document fragment, which represents a message part, here are some examples. <po> <header> <poNumber/> <city/> </header> </po> Example: bpws:appendNode("detail", "/po") Results in: <po> <header> <poNumber/> <city/> </header> <detail/> <po> Example: bpws:insertNode("detail", "/po") Results in: <po> <detail/> <header> <poNumber/> <city/> </header> <po> Example: bpws:appendNode("name", "/po/header", "poNumber") Results in: <po> <header> <poNumber/> <name/> <city/> </header> <po> Example: bpws:insertNode("name", "/po/header", "poNumber") Results in: <po> <header> <name/> <poNumber/> <city/> </header> <po> These examples would be used as part of a Assign/Copy operation. <assign> <copy> <from.../> <to variable="..." part="..." query="examples"/> </copy> </assign> Chris
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]