Parameter Sweep new artefact

Folks, while reading the ParameterSweep spec draft 13, I came again to the definition of the sweep:DocumentNode definition. The DocumentNode is defined as of type xs:string containing a XPath 2.0 expression. This is the issue that I had numerous discussions with various people about. Despite having different reasons for why changing this, I agree with all of those people that it would be not wise to leave the definition of DocumentNode as it is without amending it. In short, 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. That way, the ParameterSweep specification is independent of the tooling used by any implementer (which is a good thing :-). I therefore propose to amend the DocumentNode element with an attribute that makes the bindings explicit as follows: The attribute shall be named "mapping", and shall be defined as a mandatory anonymous XML attribute on the DocumentNode element. The attribute shall be of type "list of Strings" further constrained as follows: - It MUST have an even number of string parts. - The list MUST be formed as follows: Part 0: Namespace URI Part 1: Prefix for part 0 Part n+2: Namespace URI Part n+3: Prefix for Part n+2 The following is a brief example how the DocumentNode element would be used in a Sweep: <sweep:DocumentNode mapping="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix foo http://schemas.ggf.org/jsdl/2005/11/jsdl-posix bar"> //foo:POSIXApplication/bar:Argument[4] <sweep:DocumentNode> Note that the example is quite artificial as it binds the same namespace to two different prefixes. Nonetheless, it is a valid example. I will also add a tracker issue for this. Comments please? Cheers, Michel -- Michel Drescher Fujitsu Laboratories of Europe, Ltd. Hayes Park Central Hayes End Road Hayes, Middlesex UB4 8FE Reg. No. 4153469 +44 20 8606 4834 Michel.Drescher@uk.fujitsu.com

Hi, Based on the explanation it sounds like the right thing to do as the functionality remains unchanged, so I agree with Michel's proposal. gef p.s. The only insignificant beef that I have would be that it would be a shame if the wg (and presumably others in a similar situation) appear obliged to propose sub-optimal specs due to things being broken elsewhere. Michel Drescher wrote:
Folks,
while reading the ParameterSweep spec draft 13, I came again to the definition of the sweep:DocumentNode definition.
The DocumentNode is defined as of type xs:string containing a XPath 2.0 expression.
This is the issue that I had numerous discussions with various people about. Despite having different reasons for why changing this, I agree with all of those people that it would be not wise to leave the definition of DocumentNode as it is without amending it.
In short, 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. That way, the ParameterSweep specification is independent of the tooling used by any implementer (which is a good thing :-).
I therefore propose to amend the DocumentNode element with an attribute that makes the bindings explicit as follows:
The attribute shall be named "mapping", and shall be defined as a mandatory anonymous XML attribute on the DocumentNode element.
The attribute shall be of type "list of Strings" further constrained as follows: - It MUST have an even number of string parts. - The list MUST be formed as follows: Part 0: Namespace URI Part 1: Prefix for part 0 Part n+2: Namespace URI Part n+3: Prefix for Part n+2
The following is a brief example how the DocumentNode element would be used in a Sweep:
<sweep:DocumentNode mapping="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix foo http://schemas.ggf.org/jsdl/2005/11/jsdl-posix bar"> //foo:POSIXApplication/bar:Argument[4] <sweep:DocumentNode>
Note that the example is quite artificial as it binds the same namespace to two different prefixes. Nonetheless, it is a valid example.
I will also add a tracker issue for this.
Comments please?
Cheers, Michel
-- Michel Drescher Fujitsu Laboratories of Europe, Ltd. Hayes Park Central Hayes End Road Hayes, Middlesex UB4 8FE Reg. No. 4153469
+44 20 8606 4834 Michel.Drescher@uk.fujitsu.com
-- jsdl-wg mailing list jsdl-wg@ogf.org http://www.ogf.org/mailman/listinfo/jsdl-wg

Michel Drescher wrote:
The following is a brief example how the DocumentNode element would be used in a Sweep:
<sweep:DocumentNode mapping="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix foo http://schemas.ggf.org/jsdl/2005/11/jsdl-posix bar"> //foo:POSIXApplication/bar:Argument[4] <sweep:DocumentNode>
Note that the example is quite artificial as it binds the same namespace to two different prefixes. Nonetheless, it is a valid example.
For myself, I'd not use a list of strings in a mapping attribute because that's not just awkward to validate, but also ugly! Instead I'd go with: <sweep:DocumentNode> <sweep:Map uri="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix" prefix="foo"/> <sweep:Map uri="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix" prefix="bar"/> <sweep:Match>//foo:POSIXApplication/bar:Argument[4]</sweep:Match> </sweep:DocumentNode> I suppose this would be a good point to note that the prefixes for a particular group of Map terms would need to be unique. The scope of the uniqueness is really tight though, so I've no problem with it. But this is all just my take on things. (Gah! The W3C really ought to do a way to embed XPath in XML without all this crud, but that's outside the scope of JSDL-WG for sure, and of OGF too...) Donal.

Donal, I had thought about this and personally intentionally discarded the argument of "ugliness" - XML documents are per se ugly. ;-) But you definitely have a point in validating becomes difficult. Therefore I join forces with you, and define the Document in XML Schema as follows: ---------- SNIP ---------- SNIP ---------- SNIP ---------- SNIP ---------- <xsd:element name="NamespaceBinding"> <xsd:complexType> <xsd:attribute name="ns" type="xsd:anyURI" use="required"/> <xsd:attribute name="prefix" type="xsd:NCName" use="required" /> </xsd:complexType> </xsd:element> <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:element> ---------- SNIP ---------- SNIP ---------- SNIP ---------- SNIP ---------- The example therefore would change as follows: ---------- SNIP ---------- SNIP ---------- SNIP ---------- SNIP ---------- <sweep:DocumentNode> <sweep:NamespaceBinding ns="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix " prefix="foo" /> <sweep:NamespaceBinding ns="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix " prefix="bar" /> <sweep:Match>//foo:POSIXApplication/bar:Argument[4]</sweep:Match> </sweep:DocumentNode> ---------- SNIP ---------- SNIP ---------- SNIP ---------- SNIP ---------- Cheers, Michel On 21 Aug 2008, at 13:55, Donal K. Fellows wrote:
Michel Drescher wrote:
The following is a brief example how the DocumentNode element would be used in a Sweep: <sweep:DocumentNode mapping="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix foo http://schemas.ggf.org/jsdl/2005/11/jsdl-posix bar"> //foo:POSIXApplication/bar:Argument[4] <sweep:DocumentNode> Note that the example is quite artificial as it binds the same namespace to two different prefixes. Nonetheless, it is a valid example.
For myself, I'd not use a list of strings in a mapping attribute because that's not just awkward to validate, but also ugly! Instead I'd go with:
<sweep:DocumentNode> <sweep:Map uri="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix" prefix="foo"/> <sweep:Map uri="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix" prefix="bar"/> <sweep:Match>//foo:POSIXApplication/bar:Argument[4]</sweep:Match> </sweep:DocumentNode>
I suppose this would be a good point to note that the prefixes for a particular group of Map terms would need to be unique. The scope of the uniqueness is really tight though, so I've no problem with it. But this is all just my take on things. (Gah! The W3C really ought to do a way to embed XPath in XML without all this crud, but that's outside the scope of JSDL-WG for sure, and of OGF too...)
Donal.
-- Michel Drescher Fujitsu Laboratories of Europe, Ltd. Hayes Park Central Hayes End Road Hayes, Middlesex UB4 8FE Reg. No. 4153469 +44 20 8606 4834 Michel.Drescher@uk.fujitsu.com
participants (3)
-
Donal K. Fellows
-
geoff
-
Michel Drescher