OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

wsbpel message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Issue - 46 - Namespace for the document fragment representing a part


This issue has been added to the wsbpel issue list. 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 document with the title in the "Issues" folder of the WSBPEL TC document list - the next posting 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.

Issue - 46 - Namespace for the document fragment representing a part

Status: open
Date added: 7 Aug 2003
Submitter: Chris Keller
Date submitted: 07 August 2003
Description: The document fragment for a message part in a query attribute, as in the example on page 38 (referenced in issue 39 : Inconsistent syntax for query attribute values in spec examples ) should be namespace qualified. For XPath 1.0, all elements that have a namespace should be qualified.

In XPath 1.0 there is no default namespace for evaluation meaning that all names need to be qualified with a prefix. In XPath 2.0 there is the use of a default namespace, but this specification is referencing 1.0. Putting that aside for a moment in both 1.0 and 2.0 no namespace is not equal to default namespace. Let's take an example:

  <message name="poMessage"> 
    <part name="PO" type="tns:purchaseOrder"/> 
  </message> 

<bpws:property name="poNumber" type="xsd:positiveInteger"/>

<bpws:propertyAlias propertyName="tns:poNumber" messageType="tns:poMessage" part="PO" query="/PO/Header/PONumber"/>

</bpws:propertyAlias>

If as you suggest we assume that the Part PO is included in the query (which I agree with) and has no namespace (namespace URI is null) association. This query in order to be correct in XPath should be formulated as:

 /PO/tns:Header/tns:PONumber 

Note the section Node Tests from [URI=XPath 1.0 section 2.3 Node Tests;http://www.w3.org/TR/xpath#node-tests])

"A node test that is a QName is true if and only if the type of the node (see [5 Data Model]) is the principal node type and has an expanded-name equal to the expanded-name specified by the QName. For example, child::para selects the para element children of the context node; if the context node has no para children, it will select an empty set of nodes. attribute::href selects the href attribute of the context node; if the context node has no href attribute, it will select an empty set of nodes.

A QName in the node test is expanded into an expanded-name using the namespace declarations from the expression context. This is the same way expansion is done for element type names in start and end-tags except that the default namespace declared with xmlns is not used: if the QName does not have a prefix, then the namespace URI is null (this is the same way attribute names are expanded). It is an error if the QName has a prefix for which there is no namespace declaration n the expression context."

Note the statement "except that the default namespace declared with xmlns is not used: if the QName does not have a prefix, then the namespace URI is null"

Now in XPath 2.0 it is slightly different ([URI=XPath 2.0 section 3.2.1.2 Node Tests;http://www.w3.org/TR/xpath20/#node-tests])

"A node test that consists of a QName is called a name test. A name test is true if and only if the kind of the node is the principal node kind and the expanded-QName of the node is equal to the expanded-QName specified by the name test. For example, child::para selects the para element children of the context node; if the context node has no para children, it selects an empty set of nodes. attribute::abc:href selects the attribute of the context node with the QName abc:href; if the context node has no such attribute, it selects an empty set of nodes.

A QName in a name test is expanded into an expanded-QName using the in-scope namespaces in the expression context. It is a static error if the QName has a prefix that does not correspond to any in-scope namespace. An unprefixed QName, when used as a name test on an axis whose principal node kind is element, has the namespaceURI of the default element namespace in the expression context; otherwise, it has no namespaceURI."

Note the statement: "An unprefixed QName, when used as a name test on an axis whose principal node kind is element, has the namespaceURI of the default element namespace in the expression context; otherwise, it has no namespaceURI."

So in either case we need to qualify the namespace for your message part declared as a type example. And if we are following the XPath 1.0 specification we should qualify all elements that have a namespace since no default namespace is applied. In this case basically every query in the bpel specification is incorrect and should contain prefixes for all element names associated with namespaces in the XPath expressions.
Links: issue 39 : Inconsistent syntax for query attribute values in spec examples     Ugo Corda, 7 Aug 2003     Chris Keller, 7 Aug 2003
Changes: 7 Aug 2003 - new issue


To comment on this issue, please follow-up to this announcement on the wsbpel@lists.oasis-open.org list (replying to this message should automatically send your message to that list), or ensure the subject line as you send it starts "Issue - 46 - [anything]" or is a reply to such a message.

To add a new issue, see the issues procedures document.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]