[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: New Issue 211: Proposal for container node to simplify XML variables and message parts
The issues list is posted as a Technical Committee document to the OASIS WSBPEL TC pages on a regular basis. The current edition, as a TC document, is the most recent version of the document entitled in the "Issues" folder of the WSBPEL TC document list - the next posting as a TC document will include this issue. The list editor's working copy, which will normally include an issue when it is announced, is available at this constant URL.
Problem:
Solution:
We define a 'container node' (and later on argue exactly what to call it)
that has the following properties:
We declare that each XML variable or message part is a container node, where
the value of that variable or message part are the child nodes of the container
node. More specifically:
To handle assignments and expressions, we declare that:
[*] In XPath this is just a matter of iterating over the returned nodeset, cloning each node and appending it as a child of the container node.
Examples
Declare a variable of simple type string and assign the value 'hello world' to it:
<variable name="text" type="xsd:string"/> <assign> <copy> <from> <literal>hello world</literal> </from> <to variable="text"/> </copy> </assign>
Declare a variable that holds an element myElement and assign an element to it:
<variable name="element" element="ns:myElement"/> <assign> <copy> <from> <literal><ns:myElement>hello world</ns:myElement></literal> </from> <to variable="element"/> </copy> </assign>
Copy the text value from one variable to another:
<variable name="text2" type="xsd:string"/> <assign> <copy> <from>$text</from> <to variable="text2"/> </copy> </assign><variable name="text3" type="xsd:string"/> <assign> <copy> <from>$element/text()</from> <to variable="text3"/> </copy> </assign>
Copy an element from a complex type to an element variable:
<variable name="sequence" type="ns:myComplexType"/> <variable name="element3" element="ns:myElement"/> <assign> <copy> <from>$sequence/ns:myElement</from> <to variable="element3"/> </copy> </assign>
Evaluate an expression using a context node:
<bpws:propertyAlias propertyName="tns:taxpayerNumber" messageType="txmsg:taxpayerInfo" part="identification"> <query>/txtyp:socialsecnumber</query> </bpws:propertyAlias>Note that '/txtyp:socialsecnumber', 'txtyp:socialsecnumber' and './txtyp:socialsecnumber' are all valid and refer to the same child node.
Conformance
The XPath 1.0 specification defines a 'root node' that may be used as a context node or a node in a node-set. The XPath 1.0 specification makes no restriction on the root node that prevent us from using the container node as a root node. Any XPath 1.0 conformant implementation would support the container node.
The XPath 2.0 data model specification defines a 'document node' that may be used as a context node or any other place a node is returned. The container node has the same properties as an XPath 2.0 data model document node. Any XPath 2.0 or XQuery 1.0 conformant implementation would support the container node.
The DOM Level 1 specification defines a 'document fragment' node type. The
container node has the same properties as a DOM document fragment. An
implementation that uses the DOM can use the DocumentFragment node to represent
the container node, and to pass it to/from an XPath engine.
Changes: 2
Jun 2005 - new issue
Best
Regards,
Tony
Tony
Fletcher Technical
Advisor
| ||
Phone:
|
+44 (0) 1473 729537 | |
Mobile:
|
+44
(0) 7801 948219 | |
Fax:
|
+44 (0) 870 7390077 | |
Web: |
||
Cohesions™ | ||
Business
transaction management software for application
coordination | ||
Work: tony.fletcher@choreology.com | ||
Home: amfletcher@iee.org |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]