This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5674 - substitution groups for attributes
Summary: substitution groups for attributes
Status: RESOLVED LATER
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-02 16:55 UTC by Paolo Marinelli
Modified: 2008-06-13 17:11 UTC (History)
1 user (show)

See Also:


Attachments

Description Paolo Marinelli 2008-05-02 16:55:02 UTC
Dear all,
  one of the most interesting and powerful feature of XSDL (both 1.0 and 1.1) is represented by substitution groups. Unfortunately, substitution groups apply to element only, and not to attributes. 

Extending substitution groups to attributes would allow, e.g., to write complete "localized" form of XML vocabularies, as suggested by the example below, and as discussed in [1].

<!--================================-->
<!-- ABSTRACT VOCABULARY DEFINITION -->
<!--================================-->

<xs:element name="abstractPerson" type="abstractPersonType" abstract="true" />
<xs:complexType name="abstractPersonType" abstract="true">
  <xs:sequence>
    ...
  </xs:sequence>
  <xs:attribute ref="abstractTitle" />
</xs:complexType>

<xs:attribute name="abstractTitle" type="abstractTitleType" abstract="true" />
<xs:simpleType name="abstractTitleType">
  <xs:restriction base="xs:token" />
</xs:simpleType>

<!--===============================-->
<!-- ENGLISH VOCABULARY DEFINITION -->
<!--===============================-->

<!-- inlcude the abstract vocabulary definition -->

<xs:element name="person" type="personType" substitutionGroup="abstractPerson" />
<xs:complexType name="personType">
  <xs:complexContent>
    <xs:restriction base="abstractPersonType">
      <xs:sequence>
	      ...
      </xs:sequence>
      <xs:attribute ref="title" />
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>

<xs:attribute name="title" type="titleType" substitutionGroup="abstractTitle" />
<xs:simpleType name="titleType">
  <xs:restriction base="abstractTitleType">
    <xs:enumeration value="Mr" />
    <xs:enumeration value="Mrs" />
    <xs:enumeration value="Dr" />
  </xs:restriction>
</xs:simpleType>

<!--===============================-->
<!-- ITALIAN VOCABULARY DEFINITION -->
<!--===============================-->

<!-- inlcude the abstract vocabulary definition -->

<xs:element name="persona" type="personaType" substitutionGroup="abstractPerson" />
<xs:complexType name="personaType">
  <xs:complexContent>
    <xs:restriction base="abstractPersonType">
      <xs:sequence>
        ...
      </xs:sequence>
      <xs:attribute ref="titolo" />
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>

<xs:attribute name="titolo" type="titoloType" substitutionGroup="abstractTitle" />
<xs:simpleType name="titoloType">
  <xs:restriction base="abstractTitleType">
    <xs:enumeration value="Sig" />
    <xs:enumeration value="Sig.ra" />
    <xs:enumeration value="Dott" />
    <xs:enumeration value="Dott.ssa" />
  </xs:restriction>
</xs:simpleType>

Without substitution groups for attributes, a complete translation of the abstract vocabulary above would not be possible, as title is declared as attribute.

Do the WG members think it is a valuable feature? If so, is it reasonable to add support for such feature directly in version 1.1 of XSDL?

Thank you

Regards,
Paolo Marinelli

[1] http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2008Apr/0004.html (member-only link)
Comment 1 C. M. Sperberg-McQueen 2008-05-04 18:41:01 UTC
Speaking for myself, I think (a) yes, this facility would be useful,
both for internationalization (or rather: localization!) and for other 
forms of specialization, and (b) it would achieve greater symmetry
than we now have between elements and attributes.

The usefulness is limited a bit, I think, by the effective restriction
to top-level attributes.  To make it really possible to localize an
arbitrary schema, it would be useful to be able to substitute for
local attributes (and local elements) as well.  But this at least makes
it *possible* to write a vocabulary suitable for this form of localization
without having to avoid attributes altogether.

Myself, I would like to see a more general solution to the problem of
architectural forms -- but in the meantime, this is a modest change which
leads to a more than modest improvement in the situation.
Comment 2 C. M. Sperberg-McQueen 2008-05-09 20:11:57 UTC
On our telcon today, the WG classified this issue today as needsAgreement.
No one argued that making this change would be a bad idea, but there was
concern over possible cost and possibly unpropitious cost/benefit ratio.

And the chair warned that in view of the calendar the passage of time, 
and the editorial backlog, it is not certain that we will get changes
drafted and agreed for all items classed needsDrafting, let alone other
items, so that most items marked needsAgreement are at risk of being 
closed without change with the disposition LATER or WONTFIX. 
Comment 3 C. M. Sperberg-McQueen 2008-06-13 17:11:07 UTC
The XML Schema Working Group discussed this issue at its teleconference 
of 13 June 2008.  There was some support for the idea proposed, but the
consensus of the group as a whole is that we cannot provide this new
feature without a high cost in delay.  Henry Thompson reported that he had
spent time trying to sketch a simple approach to this issue, in the
hopes of showing that it could be done quickly, but had only succeeded in
persuading himself that it would not be quick.  So with some reluctance,
the WG agreed to close this issue with a disposition of LATER, in the
hopes of coming back to it at some future date.

Paolo (and Fabio), as the originator(s) of this proposal, the WG would
be grateful to you if you would consider this disposition of the
issue and let us know by closing the issue that you are willing to accept
the WG's decision, or by reopening it that you are dissatisfied and wish
the WG to reconsider, or wish to appeal the WG's decision to the Director.