VC-Filter, a demonstrator for the XSD vc:* attributes (was Re: [XML Schema 1.1] Is vc:facetAvailable only an attribute of xs:element? (Not an attribute of xs:simpleType?))

On 30 Apr 2009, at 09:36 , Costello, Roger L. wrote:

>
> Is xs:facetAvailable and xs:facetUnavailable only an attribute of  
> xs:element? e.g.
>
> <element name="start-time" vc:facetAvailable="xs:assert">
>   ...
> </element>
>
>
> Or, can they be an attribute of xs:simpleType? e.g.
>
> <simpleType name="documentType" vc:facetAvailable="xs:assert">
>   ...
> </simpleType>
>
>
> The schema-for-schemas (Appendix A) doesn't seem to define any of  
> the VC stuff. Neither does the DTD-for-schemas (Appendix L)

I think Michael Kay has already answered your main questions here:
the vc:* attributes can appear anywhere and are used to filter
the schema document before the schema document is checked against
the schema for schema documents.

Your questions on the subject of the version-control attributes
have prompted me to put together a simple implementation of the
vc:* version-control mechanism, in the form of an XSLT stylesheet
which takes an XML document as input, performs the filtering
required by the XSD spec, and writes the filtered document as its
result.  Parameters can be passed to set the version number,
the list of available datatypes, and the list of available
facets, against which the values of the vc:* attributes are
compared.

The stylesheet can be downloaded from

   http://www.blackmesatech.com/2009/04/xsd.vc.xsl

The stylesheet can also be invoked on user-supplied input from
the VC-Filter Web page

   http://www.blackmesatech.com/2009/04/vc.html

which allows the user to specify an input document and parameters,
applies the stylesheet, and displays the result.  This may be helpful
for those seeking to understand better how the rules of the vc:*
attributes work.  The XSLT processor in your browser is used to
perform the transform, so your schema document never leaves your
system.

VC-Filter has some gaps and shortcomings, of course; the ones
I'm aware of are noted in the documentation at

   http://www.blackmesatech.com/2009/04/vcdoc.html

I hope this is useful and/or diverting to those interested in
XSD 1.1.


-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************

Received on Monday, 4 May 2009 23:12:12 UTC