- From: Doug Davis via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 18 Aug 2009 17:21:57 +0000
- To: public-ws-resource-access-notifications@w3.org
Update of /w3ccvs/WWW/2002/ws/ra/edcopies In directory hutz:/tmp/cvs-serv346 Modified Files: wsfrag.html wsfrag.xml Log Message: first pass at adding the 2 xpath languages Index: wsfrag.html =================================================================== RCS file: /w3ccvs/WWW/2002/ws/ra/edcopies/wsfrag.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wsfrag.html 5 Aug 2009 21:00:49 -0000 1.3 +++ wsfrag.html 18 Aug 2009 17:21:55 -0000 1.4 @@ -55,16 +55,17 @@ 3.4 <a href="#Create">Create</a><br/> 4 <a href="#iddiv1_1_802">Examples</a><br/> 4.1 <a href="#iddiv2_1_805">Examples</a><br/> -5 <a href="#QName">QName Expressions</a><br/> +5 <a href="#QName">QName Expression Language</a><br/> 5.1 <a href="#QName_Get">Get</a><br/> 5.2 <a href="#QName_Put">Put</a><br/> 5.3 <a href="#QName_Delete">Delete</a><br/> 5.4 <a href="#QName_Create">Create</a><br/> -6 <a href="#XPath">XPath Expressions</a><br/> -7 <a href="#Faults">Faults</a><br/> - 7.1 <a href="#UnsupportedLanguage">UnsupportedLanguage</a><br/> -8 <a href="#acks">Acknowledgements</a><br/> -9 <a href="#refs">References</a><br/> +6 <a href="#XPathL1">XPath Level 1 Expression Language</a><br/> +7 <a href="#XPath10">XPath 1.0 Expression Language</a><br/> +8 <a href="#Faults">Faults</a><br/> + 8.1 <a href="#UnsupportedLanguage">UnsupportedLanguage</a><br/> +9 <a href="#acks">Acknowledgements</a><br/> +10 <a href="#refs">References</a><br/> </p> <h3><a name="appendices" id="appendices"/>Appendices</h3><p class="toc">A <a href="#Appendix_I__E2_80_93_XSD">XML Schema</a><br/> B <a href="#Appendix_II__E2_80_93_WSDL">WSDL</a><br/> @@ -542,7 +543,7 @@ </wst:GetResponse> </s:Body> </s:Envelope></pre></div></div></div></div><div class="div1"> -<h2><a name="QName" id="QName"/>5 QName Expressions</h2><p> +<h2><a name="QName" id="QName"/>5 QName Expression Language</h2><p> The QName expression language is a syntax for expressions that uses a single QName to reference the immediate children of the root element of @@ -580,10 +581,248 @@ identifies an existing element then the new elements are inserted after them. </p></div></div><div class="div1"> -<h2><a name="XPath" id="XPath"/>6 XPath Expressions</h2><p> - ... - </p><div class="exampleOuter"><div class="exampleInner"><pre><a href="http://www.w3.org/2009/02/ws-fra/XPath">http://www.w3.org/2009/02/ws-fra/XPath</a></pre></div></div></div><div class="div1"> -<h2><a name="Faults" id="Faults"/>7 Faults</h2><p> +<h2><a name="XPathL1" id="XPathL1"/>6 XPath Level 1 Expression Language</h2><p> + The XPath Level 1 expression language uses an XPath to + reference specific fragments of the resource representation. The XPath is + logically applied to the XML representation of the resource and the + resulting + node-set is the resource fragment which is the subject of the message + containing the expression. + This language is useful for resources with limited XPath processing + capability which do not need to support returning values computed from + their resource representation. + </p><p> + XPath Level 1 is a subset of the abbreviated relative syntax + of XPath 1.0, and is used to identify or select a node within a resource + representation or fragment. It is identified by the following URI: + </p><div class="exampleOuter"><div class="exampleInner"><pre>http://www.w3.org/2009/02/ws-fra/XPath-Level-1</pre></div></div><p> + An XPath Level 1 expression is an expression whose context is: + </p><ul><li><p> + Context Node: the root element of the XML representation of the resource + </p></li><li><p> Context Position: 1 </p></li><li><p> Context Size: 1 </p></li><li><p> Variable Binding: None </p></li><li><p> Node Tests: NameTest and the text NodeType </p></li><li><p> Function Libraries: None </p></li><li><p> + Namespace Declarations: Any namespace declarations in-scope where the + XPath expression appears + </p></li></ul><p> + An implementation that uses the XPath Level 1 language MUST support the + expressions whose syntax is described by the following BNF. It MAY + support additional expressions defined by XPath 1.0. + The following XPath Level 1 grammar is LL(1), and the + nonterminal productions are in angle brackets. Terminal symbols are + either literals, or in UPPERCASE: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <xpath> ::= <context> <node_sequence>; +(02) +(03) <context> ::= '/' | <>; +(04) +(05) <node_sequence> ::= +(06) <element> <optional_collection_operator> <more>; +(07) +(08) <optional_collection_operator> ::= '[' <array_location> ']'; +(09) <optional_collection_operator> ::= <>; +(10) +(11) <more> ::= '/' <follower> | <>; +(12) +(13) <follower> ::= +(14) <attribute> | <text_function> | <node_sequence>; +(15) +(16) <element> ::= <qualified_name>; +(17) <attribute> ::= '@' <qualified_name>; +(18) +(19) <qualified_name> ::= <name> <qname_follower>; +(20) <qname_follower> ::= ':' <name> | <>; +(21) <text_function> ::= "text()" ; +(22) <array_location> ::= NONZERO_DECIMAL_UNSIGNED_INTEGER; +(23) <name> ::= XML_TOKEN;</pre></div></div><p> + The terminal tokens which require further lexical + specification are NONZERO_DECIMAL_UNSIGNED_INTEGER, whose values are in the + subrange (1...4294967295), and XML_TOKEN whose values are equivalent to + those for the XML Schema type <em>xs:token</em>. This grammar + is small enough + that it can be easily implemented in resource-constrained implementations. + </p><p> + The following comments on the grammar will clarify certain + constructs within the BNF. + </p><p> + Most of the examples assume the following XML sample acting + as a "resource" document: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <a> +(02) <b> +(03) <c d="30"> 20 </c> +(04) </b> +(05) <e> +(06) <f/> +(07) <f/> +(08) </e> +(09) </a></pre></div></div><p> + The context and document root node need + clarification. XPath Level 1 assumes that the root is the root + node of the resource document, not the SOAP envelope or any other wrapper + element which may contain the resource. + </p><p> + Further, the default context is the root element and the + context position is 1. + </p><p> + In view of this, the / operator selects the containing root, + and the only valid operand which may follow it is the outermost element + of the resource: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) /a</pre></div></div><p>The following paths are equivalent:</p><div class="exampleOuter"><div class="exampleInner"><pre>(01) /a/b +(02) b</pre></div></div><p> + Note that because the context node is the root element, a + relative path selects a matching child element. + </p><p> + The <node_sequence> production provides the recursive + behavior for the XPath: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) /a/b/c +(02) b/c</pre></div></div><p> + It also provides for selecting specific repeated elements + through the <optional_collection_operator> production: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) /a/e/f[2]</pre></div></div><p> + The collection operator only takes unsigned nonzero values, + as defined above for NONZERO_DECIMAL_UNSIGNED_INTEGER. Thus, [1] is the + first of a repeating series of elements. + </p><p> + The <qualified_name> production allows the XML naming + tokens to be either namespace-qualified or unqualified: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) /ns1:a/ns2:b/c</pre></div></div><p> + The namespace bindings are evaluated against any namespace + declarations that are in scope where the XPath appears within the SOAP + message. + </p><p> + NOTE: If the element name is unqualified, i.e. appears + without a namespace prefix, then the element name MUST be matched against a + matching element name in the resource document, regardless of namespace + bindings that are in effect, including default bindings. This allows + implementations to simply match element names in the majority of cases. + If namespace bindings are significant for all elements, then qualified + names must be used. + </p><p> + The <follower> production allows for special-casing of + the final tokens of the XPath allowing it to end in either an attribute + or text. + </p><p> + The text() NodeTest may be applied as a final token to the + selected element. This NodeTest selects any text nodes that are + children of the selected element. If the element only contains text + content, the + return value will be a node-set containing a single text node. + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) b/c/text()</pre></div></div><p> + The above expression would return a node-set containing a + single text node with the value <em>20 </em>as its result. This text + node would then be serialized into the following XML representation: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <wsf:TextNode>20</wsf:TextNode></pre></div></div><p> + If accessed, attributes must be the final token in the path + and they may be namespace-qualified or unqualified names, as required: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) /a/b/c/@d</pre></div></div><p> + The above expression would return a node-set containing a + single attribute node with the value <em>d="30"</em> as its result. + This attribute node would then be serialized into the following XML + representation: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <wsf:AttributeNode name="d">30</wsf:AttributeNode></pre></div></div><p> + Selection of an element returns the element and its entire + content. The path <em>/a/b </em>executed against the sample XML + returns a + node-set containing a single element node which serializes directly: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <b> <c d="30"> 20 </c> </b></pre></div></div><p> + In the event that there is more than one node which would + match the XPath, the implementation SHOULD select or return the first node + only. This allows simple implementations to avoid the overhead of + checking the remainder of the resource document for a possible match. + </p><p> + Conformant implementations MAY supply additional functions + and capabilities, but MUST adhere to the minimum behavior described above. + </p><p> + Expressions in this language MUST NOT evaluate to more than a + single node. The XPath Level 1 language does not support computed values. + Text and attribute nodes MUST be serialized using the same serialization + as for the XPath 1.0 language. + </p></div><div class="div1"> +<h2><a name="XPath10" id="XPath10"/>7 XPath 1.0 Expression Language</h2><p> + The XPath 1.0 expression language uses an XPath to reference specific + fragments of the resource representation. The XPath is logically + applied to the XML representation of the resource and the result of + the XPath is returned as the value for that expression. The XPath 1.0 + language supports a + wider set of XPath function libraries than the XPath Level 1 language. + This language is + useful for resources with full XPath processing capability or which + need to support returning values computed from their resource + representation. + </p><p> + An XPath 1.0 expression is an expression whose context is: + </p><ul><li><p> + Context Node: the root element of the XML representation of the resource + </p></li><li><p>Context Position: 1</p></li><li><p>Context Size: 1</p></li><li><p>Variable Binding: None</p></li><li><p>Function Libraries: Core function library</p></li><li><p> + Namespace Declarations: Any namespace declarations in-scope where + the XPath expression appears + </p></li></ul><p> + The XPath 1.0 language can + define references to any element, attribute or value in the resource + representation and can also be used to compute values from the resource + representation. + </p><p>The XPath 1.0 language MUST be indicated by using the URI:</p><div class="exampleOuter"><div class="exampleInner"><pre><a href="http://www.w3.org/2009/02/ws-fra/XPath">http://www.w3.org/2009/02/ws-fra/XPath</a></pre></div></div><p> + Implementations that support the full XPath 1.0 language MUST + support the XPath Level 1 language. + </p><p> + Note that the expression may evaluate to one of four + possible types: a node-set, a Boolean, a number or a string. The + latter three types are the results of evaluating a computed expression. + They are serialized + by performing the following conversion and then wrapping the result in + the wsf:Value element: + </p><ul><li><p>Boolean - converted to an xs:boolean</p></li><li><p>string - convert to an xs:string</p></li><li><p>number - convert to an xs:double</p></li></ul><p> + A node-set is zero or more elements, attributes or text + values of elements. A node-set is serialized into XML by + concatenating each + node and enclosing it in the wsf:Value wrapper XML element for which + schema + validation is suppressed. Element nodes in a node-set are serialized + directly + into their XML representation. For attributes and text nodes in the + node-set, + a wrapper element is used to enclose these values to distinguish them from + other such nodes in the serialized result. + </p><p> + Attribute nodes in XPath are represented in the following form: + </p><div class="exampleOuter"><div class="exampleInner"><pre>name="value"</pre></div></div><p> + Serialization of an attribute node separates the name from + the value using the following element: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <wsf:AttributeNode name="<em>attribute name</em>"> +(02) <em>attribute value</em> +(03) </wsf:AttributeNode></pre></div></div><p> + The following describes additional constraints on the outline + listed above: + </p><dl><dt class="label"> wsf:AttributeNode </dt><dd><p> + This element is used to serialize an attribute node in a + node-set and MUST contain the value portion of the attribute node. + </p></dd><dt class="label"> wsf:AttributeNode/@name </dt><dd><p> + This attribute MUST be the name portion of the attribute node. + </p></dd></dl><p> + Text nodes are serialized in the following form: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <wsf:TextNode> +(02) <em>text value</em> +(03) </wsf:TextNode></pre></div></div><p>The following describes additional constraints on the + outline listed above:</p><p>wsf:TextNode</p><p> + This element is used to serialize a text node in a node-set + and MUST contain the text value. + </p><p>Given the following XML as an example document.</p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <a xmlns="example"> +(02) <b>1</b> +(03) <c x="y">2</c> +(04) </a></pre></div></div><p> + The result of the XPath "/a/b | /a/b/text() | /a/c/@x" would + be serialized as the following: + </p><div class="exampleOuter"><div class="exampleInner"><pre>(01) <wsf:Value> +(02) <b>1</b> +(03) <wsf:TextNode>1</wsf:TextNode> +(04) <wsf:AttributeNode name="x">y</wsf:AttributeNode> +(05) </wsf:Value></pre></div></div><p>The nodes in the node-set MAY be serialized in any order.</p><p> + The WS-Fragment global element definition wsf:NodeSet can also be + used as the wrapper element when serializing these node-sets outside of + a WS-RT result. + </p><p> + An XPath 1.0 expression may evaluate to multiple nodes; + because of this the XPath 1.0 language MUST NOT be used with a "Put" or + "Create" operation. + </p></div><div class="div1"> +<h2><a name="Faults" id="Faults"/>8 Faults</h2><p> All fault messages defined in this specification MUST be sent according to the rules and usage described in <a href="#WSABinding">[WS-Addressing 1.0 SOAP Binding]</a> @@ -631,13 +870,13 @@ </s11:Fault> </s11:Body> </s11:Envelope></pre></div></div><div class="div2"> -<h3><a name="UnsupportedLanguage" id="UnsupportedLanguage"/>7.1 UnsupportedLanguage</h3><p> +<h3><a name="UnsupportedLanguage" id="UnsupportedLanguage"/>8.1 UnsupportedLanguage</h3><p> This fault is generated when a service detects an unknown Language URI in a request message. </p><a name="Table3" id="Table3"/><table border="1" cellpadding="5"><tbody><tr><th align="left"><b>[Code]</b></th><td>s:Sender</td></tr><tr><th align="left"><b>[Subcode]</b></th><td>wst:UnknownLanguage</td></tr><tr><th align="left"><b>[Reason]</b></th><td> The specified Language URI is not known. </td></tr><tr><th align="left"><b>[Detail]</b></th><td><em>The unknown URI if specified</em></td></tr></tbody></table></div></div><div class="div1"> -<h2><a name="acks" id="acks"/>8 Acknowledgements</h2><p> +<h2><a name="acks" id="acks"/>9 Acknowledgements</h2><p> This specification has been developed as a result of joint work with many individuals and teams, including: Ashok Malhotra (Oracle Corp.), @@ -659,7 +898,7 @@ Wu Chou (Avaya Communications), Yves Lafon (W3C) </p></div><div class="div1"> -<h2><a name="refs" id="refs"/>9 References</h2><dl><dt class="label"><a name="Rfc2119" id="Rfc2119"/>RFC 2119</dt><dd><a href="http://www.ietf.org/rfc/rfc2119.txt"><cite> +<h2><a name="refs" id="refs"/>10 References</h2><dl><dt class="label"><a name="Rfc2119" id="Rfc2119"/>RFC 2119</dt><dd><a href="http://www.ietf.org/rfc/rfc2119.txt"><cite> Key words for use in RFCs to Indicate Requirement Levels </cite></a> , S. Bradner, Harvard University, March 1997. @@ -737,7 +976,7 @@ <h2><a name="ChangeLog" id="ChangeLog"/>C Change Log</h2><table border="1"><tbody><tr><th> Data </th><th> Author </th><th> Description </th></tr><tr><td> 2009/03/04 </td><td> DD </td><td> Added resolution of issue <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=xxxx">xxxx</a></td></tr></tbody></table></div><div class="div1"> <h2><a name="Questions" id="Questions"/>D Open Questions and Actions</h2><p> - Ram - If the expression resolves to a non-existent noe should it fault + Ram - If the expression resolves to a non-existent node should it fault or do nothing? </p><p> Ram - should we allow for the creation with default value? This is, @@ -745,8 +984,6 @@ </p><p> Ram - add an invalidExpression, NonExistentNode fault. </p><p> - Add the 2 xpath expressions languages defined by RT - </p><p> Ram - add a general fault to indicate that a fragment message is invalid. </p><p> Dug - on put - Should the client really be forced to know whether or not Index: wsfrag.xml =================================================================== RCS file: /w3ccvs/WWW/2002/ws/ra/edcopies/wsfrag.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wsfrag.xml 5 Aug 2009 21:00:49 -0000 1.3 +++ wsfrag.xml 18 Aug 2009 17:21:55 -0000 1.4 @@ -1000,7 +1000,7 @@ </div1> <div1 id="QName"> - <head>QName Expressions</head> + <head>QName Expression Language</head> <p> The QName expression language is a syntax for expressions that uses a single QName to reference the immediate children of the root @@ -1062,14 +1062,465 @@ </div2> </div1> - <div1 id="XPath"> - <head>XPath Expressions</head> + <div1 id="XPathL1"> + <head>XPath Level 1 Expression Language</head> + <p> - ... + The XPath Level 1 expression language uses an XPath to + reference specific fragments of the resource representation. The XPath is + logically applied to the XML representation of the resource and the + resulting + node-set is the resource fragment which is the subject of the message + containing the expression. + This language is useful for resources with limited XPath processing + capability which do not need to support returning values computed from + their resource representation. + </p> + + <p> + XPath Level 1 is a subset of the abbreviated relative syntax + of XPath 1.0, and is used to identify or select a node within a resource + representation or fragment. It is identified by the following URI: </p> + + <example> + <eg>http://www.w3.org/2009/02/ws-fra/XPath-Level-1</eg> + </example> + + <p> + An XPath Level 1 expression is an expression whose context is: + </p> + + <ulist> + <item> + <p> + Context Node: the root element of the XML representation of the resource + </p> + </item> + <item> <p> Context Position: 1 </p> </item> + <item> <p> Context Size: 1 </p> </item> + <item> <p> Variable Binding: None </p> </item> + <item> <p> Node Tests: NameTest and the text NodeType </p> </item> + <item> <p> Function Libraries: None </p> </item> + <item> + <p> + Namespace Declarations: Any namespace declarations in-scope where the + XPath expression appears + </p> + </item> + </ulist> + <p> + An implementation that uses the XPath Level 1 language MUST support the + expressions whose syntax is described by the following BNF. It MAY + support additional expressions defined by XPath 1.0. + The following XPath Level 1 grammar is LL(1), and the + nonterminal productions are in angle brackets. Terminal symbols are + either literals, or in UPPERCASE: + </p> + + <example> + <eg>(01) <xpath> ::= <context> <node_sequence>; +(02) +(03) <context> ::= '/' | <>; +(04) +(05) <node_sequence> ::= +(06) <element> <optional_collection_operator> <more>; +(07) +(08) <optional_collection_operator> ::= '[' <array_location> ']'; +(09) <optional_collection_operator> ::= <>; +(10) +(11) <more> ::= '/' <follower> | <>; +(12) +(13) <follower> ::= +(14) <attribute> | <text_function> | <node_sequence>; +(15) +(16) <element> ::= <qualified_name>; +(17) <attribute> ::= '@' <qualified_name>; +(18) +(19) <qualified_name> ::= <name> <qname_follower>; +(20) <qname_follower> ::= ':' <name> | <>; +(21) <text_function> ::= "text()" ; +(22) <array_location> ::= NONZERO_DECIMAL_UNSIGNED_INTEGER; +(23) <name> ::= XML_TOKEN;</eg> + </example> + + <p> + The terminal tokens which require further lexical + specification are NONZERO_DECIMAL_UNSIGNED_INTEGER, whose values are in the + subrange (1...4294967295), and XML_TOKEN whose values are equivalent to + those for the XML Schema type <emph>xs:token</emph>. This grammar + is small enough + that it can be easily implemented in resource-constrained implementations. + </p> + + <p> + The following comments on the grammar will clarify certain + constructs within the BNF. + </p> + + <p> + Most of the examples assume the following XML sample acting + as a "resource" document: + </p> + + <example> + <eg>(01) <a> +(02) <b> +(03) <c d="30"> 20 </c> +(04) </b> +(05) <e> +(06) <f/> +(07) <f/> +(08) </e> +(09) </a></eg> + </example> + + <p> + The context and document root node need + clarification. XPath Level 1 assumes that the root is the root + node of the resource document, not the SOAP envelope or any other wrapper + element which may contain the resource. + </p> + + <p> + Further, the default context is the root element and the + context position is 1. + </p> + + <p> + In view of this, the / operator selects the containing root, + and the only valid operand which may follow it is the outermost element + of the resource: + </p> + + <example> + <eg>(01) /a</eg> + </example> + + <p>The following paths are equivalent:</p> + + <example> + <eg>(01) /a/b +(02) b</eg> + </example> + + <p> + Note that because the context node is the root element, a + relative path selects a matching child element. + </p> + + <p> + The <node_sequence> production provides the recursive + behavior for the XPath: + </p> + + <example> + <eg>(01) /a/b/c +(02) b/c</eg> + </example> + + <p> + It also provides for selecting specific repeated elements + through the <optional_collection_operator> production: + </p> + + <example> + <eg>(01) /a/e/f[2]</eg> + </example> + + <p> + The collection operator only takes unsigned nonzero values, + as defined above for NONZERO_DECIMAL_UNSIGNED_INTEGER. Thus, [1] is the + first of a repeating series of elements. + </p> + + <p> + The <qualified_name> production allows the XML naming + tokens to be either namespace-qualified or unqualified: + </p> + + <example> + <eg>(01) /ns1:a/ns2:b/c</eg> + </example> + + <p> + The namespace bindings are evaluated against any namespace + declarations that are in scope where the XPath appears within the SOAP + message. + </p> + + <p> + NOTE: If the element name is unqualified, i.e. appears + without a namespace prefix, then the element name MUST be matched against a + matching element name in the resource document, regardless of namespace + bindings that are in effect, including default bindings. This allows + implementations to simply match element names in the majority of cases. + If namespace bindings are significant for all elements, then qualified + names must be used. + </p> + + <p> + The <follower> production allows for special-casing of + the final tokens of the XPath allowing it to end in either an attribute + or text. + </p> + + <p> + The text() NodeTest may be applied as a final token to the + selected element. This NodeTest selects any text nodes that are + children of the selected element. If the element only contains text + content, the + return value will be a node-set containing a single text node. + </p> + + <example> + <eg>(01) b/c/text()</eg> + </example> + + <p> + The above expression would return a node-set containing a + single text node with the value <emph>20 </emph>as its result. This text + node would then be serialized into the following XML representation: + </p> + + <example> + <eg>(01) <wsf:TextNode>20</wsf:TextNode></eg> + </example> + + <p> + If accessed, attributes must be the final token in the path + and they may be namespace-qualified or unqualified names, as required: + </p> + + <example> + <eg>(01) /a/b/c/@d</eg> + </example> + + <p> + The above expression would return a node-set containing a + single attribute node with the value <emph>d="30"</emph> as its result. + This attribute node would then be serialized into the following XML + representation: + </p> + + <example> + <eg>(01) <wsf:AttributeNode name="d">30</wsf:AttributeNode></eg> + </example> + + <p> + Selection of an element returns the element and its entire + content. The path <emph>/a/b </emph>executed against the sample XML + returns a + node-set containing a single element node which serializes directly: + </p> + + <example> + <eg>(01) <b> <c d="30"> 20 </c> </b></eg> + </example> + + <p> + In the event that there is more than one node which would + match the XPath, the implementation SHOULD select or return the first node + only. This allows simple implementations to avoid the overhead of + checking the remainder of the resource document for a possible match. + </p> + + <p> + Conformant implementations MAY supply additional functions + and capabilities, but MUST adhere to the minimum behavior described above. + </p> + + <p> + Expressions in this language MUST NOT evaluate to more than a + single node. The XPath Level 1 language does not support computed values. + Text and attribute nodes MUST be serialized using the same serialization + as for the XPath 1.0 language. + </p> + </div1> + + <div1 id="XPath10"> + <head>XPath 1.0 Expression Language</head> + + <p> + The XPath 1.0 expression language uses an XPath to reference specific + fragments of the resource representation. The XPath is logically + applied to the XML representation of the resource and the result of + the XPath is returned as the value for that expression. The XPath 1.0 + language supports a + wider set of XPath function libraries than the XPath Level 1 language. + This language is + useful for resources with full XPath processing capability or which + need to support returning values computed from their resource + representation. + </p> + + <p> + An XPath 1.0 expression is an expression whose context is: + </p> + + <ulist> + <item> + <p> + Context Node: the root element of the XML representation of the resource + </p> + </item> + <item> <p>Context Position: 1</p> </item> + <item> <p>Context Size: 1</p> </item> + <item> <p>Variable Binding: None</p> </item> + <item> <p>Function Libraries: Core function library</p> </item> + <item> + <p> + Namespace Declarations: Any namespace declarations in-scope where + the XPath expression appears + </p> + </item> + </ulist> + + <p> + The XPath 1.0 language can + define references to any element, attribute or value in the resource + representation and can also be used to compute values from the resource + representation. + </p> + + <p>The XPath 1.0 language MUST be indicated by using the URI:</p> <example> <eg><loc href="http://www.w3.org/2009/02/ws-fra/XPath">http://www.w3.org/2009/02/ws-fra/XPath</loc></eg> </example> + + <p> + Implementations that support the full XPath 1.0 language MUST + support the XPath Level 1 language. + </p> + + <p> + Note that the expression may evaluate to one of four + possible types: a node-set, a Boolean, a number or a string. The + latter three types are the results of evaluating a computed expression. + They are serialized + by performing the following conversion and then wrapping the result in + the wsf:Value element: + </p> + <ulist> + <item> <p>Boolean - converted to an xs:boolean</p> </item> + <item> <p>string - convert to an xs:string</p> </item> + <item> <p>number - convert to an xs:double</p> </item> + </ulist> + + <p> + A node-set is zero or more elements, attributes or text + values of elements. A node-set is serialized into XML by + concatenating each + node and enclosing it in the wsf:Value wrapper XML element for which + schema + validation is suppressed. Element nodes in a node-set are serialized + directly + into their XML representation. For attributes and text nodes in the + node-set, + a wrapper element is used to enclose these values to distinguish them from + other such nodes in the serialized result. + </p> + + <p> + Attribute nodes in XPath are represented in the following form: + </p> + + <example> + <eg>name="value"</eg> + </example> + + <p> + Serialization of an attribute node separates the name from + the value using the following element: + </p> + + <example> + <eg>(01) <wsf:AttributeNode name="<emph>attribute name</emph>"> +(02) <emph>attribute value</emph> +(03) </wsf:AttributeNode></eg> + </example> + + <p> + The following describes additional constraints on the outline + listed above: + </p> + + <glist> + <gitem> + <label> wsf:AttributeNode </label> + <def> + <p> + This element is used to serialize an attribute node in a + node-set and MUST contain the value portion of the attribute node. + </p> + </def> + </gitem> + + <gitem> + <label> wsf:AttributeNode/@name </label> + <def> + <p> + This attribute MUST be the name portion of the attribute node. + </p> + </def> + </gitem> + </glist> + + <p> + Text nodes are serialized in the following form: + </p> + + <example> + <eg>(01) <wsf:TextNode> +(02) <emph>text value</emph> +(03) </wsf:TextNode></eg> + </example> + + <p>The following describes additional constraints on the + outline listed above:</p> + + <p>wsf:TextNode</p> + + <p> + This element is used to serialize a text node in a node-set + and MUST contain the text value. + </p> + + <p>Given the following XML as an example document.</p> + + <example> + <eg>(01) <a xmlns="example"> +(02) <b>1</b> +(03) <c x="y">2</c> +(04) </a></eg> + </example> + + <p> + The result of the XPath "/a/b | /a/b/text() | /a/c/@x" would + be serialized as the following: + </p> + + <example> + <eg>(01) <wsf:Value> +(02) <b>1</b> +(03) <wsf:TextNode>1</wsf:TextNode> +(04) <wsf:AttributeNode name="x">y</wsf:AttributeNode> +(05) </wsf:Value></eg> + </example> + + <p>The nodes in the node-set MAY be serialized in any order.</p> + + <p> + The WS-Fragment global element definition wsf:NodeSet can also be + used as the wrapper element when serializing these node-sets outside of + a WS-RT result. + </p> + + <p> + An XPath 1.0 expression may evaluate to multiple nodes; + because of this the XPath 1.0 language MUST NOT be used with a "Put" or + "Create" operation. + </p> </div1> <div1 id="Faults"> @@ -1396,7 +1847,7 @@ <div1 id="Questions"> <head>Open Questions and Actions</head> <p> - Ram - If the expression resolves to a non-existent noe should it fault + Ram - If the expression resolves to a non-existent node should it fault or do nothing? </p> <p> @@ -1408,10 +1859,6 @@ </p> <p> - Add the 2 xpath expressions languages defined by RT - </p> - - <p> Ram - add a general fault to indicate that a fragment message is invalid. </p>
Received on Tuesday, 18 August 2009 17:22:08 UTC