This is a static archive of the previous Open Grid Forum GridForge content management system saved from host forge.ogf.org file /sf/sfmain/do/go/artf6271?selectedTab=comments at Sun, 06 Nov 2022 19:25:40 GMT SourceForge : artf6271: DocumentNode needs explicit namespace bindings

Project Home

Tracker

Documents

Tasks

Source Code

Discussions

File Releases

Wiki

Project Admin

JSDL calendar
Search Tracker
Project: JSDL-WG     Trackers > [CLOSED] Parameter Sweep > View Artifact
Artifact artf6271 : DocumentNode needs explicit namespace bindings
Tracker: [CLOSED] Parameter Sweep
Title: DocumentNode needs explicit namespace bindings
Description:
From an E-Mail to the list: 
"[...] XML tooling does not universally provide namespace bindings declared in the containing XML document ([XML 
Namespace] spec is in complete silence whether namespace bindings are in scope for XML *content*), or do not guarantee 
that namespace bindings are up to date to match the prefixes used in the XPath expression. That means that the XPath 
processor has no guarantee that it can resolve all prefixes used in the XPath expression can be resolved to the correct 
namespaces, or even to any namespace at all.

The solution is to make the namespace bindings explicit that have been used to construct the XPath expression."
Submitted By: Michel Drescher
Submitted On: 08/21/2008 7:57 AM EDT
Last Modified: 09/05/2008 4:19 AM EDT
Closed: 09/04/2008 11:23 AM EDT

Status / Comments Change Log Associations Attachments  
Status  
Group: *
Status:* Closed
Category: *
Customer: *
Priority: * 1
Assigned To: * geoff williams
Reported in Release: *
Fixed in Release: *
Estimated Hours: * 0
Actual Hours: * 0
Comments
geoff williams: 09/05/2008 4:19 AM EDT
  Comment:
Email of 4th Sept '08 (15:56)

> Hi Michel,
>
> The only queries I have are:
>
> 1) In the situation where someone defines the jsdl namespace to be  the default namespace and tries to reference a jsdl element in the  XPath 
expression e.g.:
>
> <TotalCPUCount>4</TotalCPUCount>
>
> <sweep:Match>//TotalCPUCount</sweep:Match>
>
> we're currently saying a NamespaceBinding must be declared yet I  presume that it would be not be required - as such should the  NamespaceBinding 
element have a minOccurs of 0?


In XML Documents, as you say, a default namespace may be declared. As  a consequence, the namespace prefix is not used for those elements  that shall 
be taken from the default namespace, yet there is still a  namespace present and always defined for that element in question. In  short, in XML 
Documents that are validated against a XML Schema that  declares "elementDefault=qualified" any XML element and attribute is  associated with a 
namespace, at the very least a *default* namespace.  JSDL and JSDL Parameter Sweeps both declare that elements (do we do  that for attributes, too?) 
must be qualified at all times.

Different for XPath expressions. In XPath one can use elements and  attributes that do have namespaces and elements and attributes that  have *no* 
namespace(!). XPath does not have a notion (AFAIK) of a  default namespace, i.e. either elements and attributes have no  namespace (like your 
TotalCPUCount example) or the do have a  namespace, which MUST be used using a bound prefix.

So your example expression must be changed to the following:

<sweep:Match>//jsdl:TotalCPUCount</sweep:Match>

given that the "jsdl" prefix is bound to the JSDL 1.0 namespace.


> 2) In Donal's original response he notes the uniqueness of the  prefix values. If required I think that this could be achieved  through use of :
>
>>    <xsd:element name="DocumentNode"
>>                 substitutionGroup="sweep:Parameter">
>>        <xsd:complexType>
>>            <xsd:sequence>
>>                <xsd:element ref="sweep:NamespaceBinding"
>>                             minOccurs="1" maxOccurs="unbounded" />
>>                <xsd:element name="Match" type="xsd:string" />
>>            </xsd:sequence>
>>        </xsd:complexType>
>>        <xsd:unique name="uniqueNsBindingPrefix">
>>          <xsd:selector xpath="sweep:NamespaceBinding" />
>>          <xsd:field xpath="@prefix" />
>>        </xsd:unique>
>>    </xsd:element>


By way of XML Schema elements you are right. By way of experience and  tooling support I strongly advice against using xsd:unique to enforce  
uniqueness on the prefixes. My experience shows me that a textual  constraint using MUST and MUST NOT etc works far better and is less of  confusion 
in interop sessions.
So I would prefer keeping the text as it is right now.

> 3) We may also need to make a minor change to section 3.1, paragraph  2, of the spec. e.g.
>
> Current: "The type of the DocumentNode element is an XPath 2.0  expression [XPATH].."
> ChangeTo: "The type of the DocumentNode's Match element is an XPath  2.0 expression [XPATH].."
  Action: Update
geoff williams: 09/04/2008 11:23 AM EDT
  Comment:
See email of 4th Sept '08 @ 15:56 regarding this artifact closure.
  Action: Update
Assigned To changed from Donal Fellows to geoff williams
Closed set to 09/04/2008
Status changed from Fixed to Closed
Michel Drescher: 08/29/2008 6:06 AM EDT
  Comment:
No comments received on the mailing list for the draft text on this issue so I consider the approach as generally accepted.
  Action: Update
Assigned To changed from Michel Drescher to Donal Fellows
Status changed from Resolved to Fixed
Andreas Savva: 08/21/2008 10:15 PM EDT
  Action: Update
Assigned To set to Michel Drescher
Andreas Savva: 08/21/2008 10:15 PM EDT
  Comment:
This was resolved on the list, thread starting with http://www.ogf.org/pipermail/jsdl-wg/2008-August/001092.html
  Action: Update
Status changed from Open to Resolved
Michel Drescher: 08/21/2008 7:57 AM EDT
  Action: Create


 
 


The Open Grid Forum Contact Webmaster | Report a problem | GridForge Help
This is a static archive of the previous Open Grid Forum GridForge content management system saved from host forge.ogf.org file /sf/sfmain/do/go/artf6271?selectedTab=comments at Sun, 06 Nov 2022 19:25:40 GMT