Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: anyAttribute via attributeGroup refs problem

From: Michael Glavassevich <mrglavas@--.---.--->
To: ht@---.--.--.-- (----- -. --------)
Date: 11/13/2008 2:30:00 AM
ht@i... wrote on 11/11/2008 08:36:12 AM:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Michael Kay writes:
>
> >> Yes, I would have expected a union in the same way single
> >> attribute definitions form a union, since my personal view up
> >> to now on "anyAttribute" was that it's just a slightly more
> >> generalized "attribute". Obviously, it's not, but treated
> >> quite differently. Haven't thought on this long enough, but:
> >> are there use cases for namespace intersections?
>
> Yes, when you have negated wildcards (##other), intersection is
> typically what you want.  Consider a v1 schema designed for
> extensibility, which includes a attribute for 'standard'
> attributes, and an allowance for extensibility:
>
>  <xs:attributeGroup name="standard">
>   <xs:attribute ref="xml:base"/>
>   <xs:attribute ref="xml:id"/>
>   <xs:attribute ref="v1:owner"/>
>   . . .
>   <xs:anyAttribute namespace="##other" processContents="lax"/>
>  </xs:attributeGroup>
>
> Now, in the v2 schema, I want to define a group which adds an
> attribute to that group and still allows extension:
>
>  <xs:attributeGroup name="standard">
>   <xs:attributeGroup ref="v1:standard"/>
>   <xs:attribute ref="v2:status"/>
>   <xs:anyAttribute namespace="##other" processContents="lax"/>
>  </xs:attributeGroup>

Assuming v1 and v2 are bound to different namespaces I don't believe this
is legal [1] (see clause 2 of Attribute Group Definition Representation OK)
in XML Schema 1.0. I'm pretty sure in Xerces we emit an error because the
intersection [2] of the two negations is not expressible.

> Intersection is what you want here -- extension attributes are allowed
> provided they are qualified with _neither_ v1 _nor_ v2.  Union would
> be useless, as that would allow _any_ qualification, including v1 or
> v2.
>
> I agree the situation is less than ideal, one would really like much
> more detailed control over what happens.
>
> ht
> - --
>        Henry S. Thompson, School of Informatics, University of Edinburgh
>                          Half-time member of W3C Team
>       10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131
650-4440
>                 Fax: (44) 131 651-1426, e-mail: ht@i...
>                        URL: http://www.ltg.ed.ac.uk/~ht/
> [mail really from me _always_ has this .sig -- mail without it is forged
spam]

Thanks.

[1] http://www.w3.org/TR/xmlschema-1/#src-attribute_group
[2] http://www.w3.org/TR/xmlschema-1/#cos-aw-intersect

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@c...
E-mail: mrglavas@a...


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent