Re: Redeclaring attribute in derived type

Jeni Tennison <jeni@jenitennison.com> wrote on 12/22/01 3:38:03 AM:

>I assume that this element could appear just about anywhere (otherwise
>you could probably constrain it more easily using content models)?

I have an element X.  Within X there are several element types that can 
appear only once each, in any order, and an additional element type that may 
appear more than once. 

>Another approach that you could use would be to use a different type
>for the id attribute (e.g. xs:Name) and create an identity constraint
>with xs:key within the declaration for the document element, something
>like:
>
>  <xs:key name="uniqueElement">
>    <xs:selector xpath=".//elementName" />
>    <xs:field xpath="@id" />
>  </xs:key>
>
>(This says that within the document, every element called
>'elementName' has to have a unique value for its id attribute.)
>
>Since this doesn't use xs:ID as the attribute type, this would enable
>you to use 'fixed' to fix the value of the id attribute.

Yeah that sounds interesting, I'll have to look into it.

>Well, Xerces-C++ and now Xerces-J v2 claim to cover all of XML Schema
>now. I haven't tried Xerces-J yet, but I haven't yet come across
>anything that Xerces-C++ doesn't handle. Those are both from
>xml.apache.org.

Those don't sound like stand-alone, end user applications (?).

>There's also MSXML4 (although that implementation is still a bit
>dodgy, particularly with identity constraints) and MSV (multi-schema
>validator from
>http://www.sun.com/software/xml/developers/multischema/).
>
>I think it's a good idea at the moment to have a range of validators
>to try things out with.

Thanks for the suggestions, I'll check them out.

// Jesse

Received on Monday, 24 December 2001 18:57:50 UTC