[XSCH] Component Designators

Hi

I have read (well skimmed)

http://www.w3.org/TR/2004/WD-xmlschema-ref-20040716/
[[
XML Schema: Component Designators
W3C Working Draft 16 July 2004
]]

Relevant sections are:
2.2 Use Cases
http://www.w3.org/TR/2004/WD-xmlschema-ref-20040716/#section-usecases

4.2.4 Simple Type Definition
http://www.w3.org/TR/2004/WD-xmlschema-ref-20040716/#simple-type-def-component

6 Example
http://www.w3.org/TR/2004/WD-xmlschema-ref-20040716/#section-example

particularly:
[[
The following is a global simple type definition component,

<!-- Stock Keeping Unit, a code for identifying products -->
<xsd:simpleType name="SKU">
  <xsd:restriction base="xsd:string">
   <xsd:pattern value="\d{3}-[A-Z]{2}"/>
  </xsd:restriction>
</xsd:simpleType>

The canonical schema component designator for this simple type 
definition [and ...] are,

schema-URI#xscd(/type(SKU))
]]

basically that looks OK.
Standard usage of these for SW would be to have named simple types like 
this one and then use X-Pointer fragment IDs like
#xscd(/type(*name*))
where *name* is the name of the type. Slightly more complicated than 
just using *name* by itself, but only a little.
For element declarations (whatever they are) it is permitted to use 
*name* by itself e.g. #xscd(/purchaseOrder) instead of 
#xscd(/element(purchaseOrder)). It might be possible to request that 
this abbreviation should also be open to simple types - personally I 
don't think it's worth the effort.


I need to fully understand when a namespace prefix is needed, because 
that seriously complicates things, since the namespace binding has to be 
included in the xpointer expression using the xmlns() syntax. In section 
4.2.4, I believe this relates to the target-namespace.

Assuming we go with this, our note should indicate both:
a) an example of using xmlns()
b) an explanation of how to avoid the need for this
i.e. we need to give simple recipes as to how to use this stuff 
reasonably effectively, in the SW

A final issue is that in N3 it is conventional to write XML schema 
datatypes with QName convention e.g. xsd:int. However, the thing after 
the : should be an NCName from Namespaces in XML. If we use these xscd 
constructs, and my is a namespace prefix for a schema document defining 
a type foo then
    my:xscd(/type(foo))
is not a legal QName, and in fact, no legal QName can be constructed for 
the URI
&my;xscd(/type(foo))

(where &my; is an entity referring to the same base URI)

I think that it makes sense to provisionally go with this solution to 
the naming of user-defined simple types.

Jeremy

Received on Tuesday, 28 September 2004 11:24:58 UTC