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 3945 - Ability to "deprecate" elements in a schema
Summary: Ability to "deprecate" elements in a schema
Status: RESOLVED WORKSFORME
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: unclassified
Depends on:
Blocks:
 
Reported: 2006-11-02 17:22 UTC by Derek Johnson
Modified: 2007-05-02 00:50 UTC (History)
0 users

See Also:


Attachments

Description Derek Johnson 2006-11-02 17:22:25 UTC
We have published an extension architecture which is primarily defined through an XML schema.  We would like the ability to deprecate out-dated elements as we move our architecture forward, so our XML validators would have the chance to flag them.
Comment 1 C. M. Sperberg-McQueen 2007-03-01 00:30:20 UTC
Sorry for the lack of response to the issue you raise.  The following
comments reflect my individual views; I am not speaking for the
WG or any organization.

At the moment, you can add

 <xsd:annotation>
  <xsd:appinfo>
   <my:deprecate date="2006-11-02" level="2"/>
  </xsd:appinfo>
 </xsd:annotation>

to the declaration of each element or type you wish to
deprecate.  Or more simply, you can add attributes to the
declarations:

  <xsd:element name="unit" my:status="deprecated">
    ...
  </xsd:element>

Any processor which provides access to the full PSVI 
will point from the element to the governing element
declaration and governing type definition, and you can
check the appinfo to see if the element is deprecated
or allowed.  (Alternatively, it would not be terribly
difficult to write an XSLT stylesheet to read schema
documents in which deprecations are marked in this way,
and generate an XSLT stylesheet which reads instances and
generates messages when it sees deprecated elements or
types.  That way you don't need access to the full PSVI.) 

But I assume you already knew that, and that you don't want
to do that, but have the deprecation somehow understood and
processed by the schema-based validator.

What would you like the schema processor to do with 
deprecated elements?  Accept them, since they are after all
valid?  Reject them, since they are after all deprecated?
Support a run-time switch to reject, or to raise a warning
when it sees, deprecated elements or types in use?

Signaling that something has been deprecated is clearly an
important part of managing a vocabulary.  But it's not immediately
clear, at least to me, what effect such deprecation might or
should have on schema-validity assessment.  Your thoughts on this
topic would be welcome.  I don't want to promise much -- XML
Schema 1.1 is long overdue and the Working Group may well wish
not to undertake any new work.  But if you have specific proposals,
I'd like to hear them.

Comment 2 David Ezell 2007-03-29 13:37:18 UTC
On 2007-03-29 the WG discussed this issue at its f2f meeting.  The WG determined that MSM gave a good answer to the issue in Comment #1.  Accordingly we have classified it as WORKSFORME.
Comment 3 C. M. Sperberg-McQueen 2007-05-02 00:50:27 UTC
Comment #2 should have added explicitly that the Working Group requests
that Derek Johnson, as the originator of the issue, indicate whether you
are satisfied with the WG's response and its rationale, either by
changing the status of the bug to CLOSED, to indicate that you are
content with the disposition of the question (or at least resigned to it),
or else by changing it to REOPENED to indicate that you're not satisified
and wish the WG to reconsider (or failing that, that you wish to lodge
a formal objection to the WG's decision and appeal it to the Director
at the next document review).  In the latter case, it would be helpful
if you respond to the ideas in comment #1.

If we don't hear from you in a couple of weeks, we'll assume that
silence implies consent, and close the issue on your behalf.

Thank you!