[jsdl-wg] Parameter Sweep new artefact

Michel Drescher Michel.Drescher at uk.fujitsu.com
Thu Aug 21 08:16:17 CDT 2008


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 at uk.fujitsu.com






More information about the jsdl-wg mailing list