OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] What does "optional" mean?

Mukul Gandhi scripsit:

> Following is an use case, that probably makes the notion of "optional"
> in XML documents *necessary*,
> Let's assume, that a book object may be represented in an XML format


> i.e, an ISBN number of book may be represented either as an attribute
> or as a child element of element book, but not at both of these
> places. To define a schema for this need (at least with XSD I
> believe), a schema author I think *must* make the attribute "isbn" and
> the element "isbn" as optional and constrain a singular cardinality of
> the semantic information "isbn" via another schema constraint.

That is indeed an XSD 1.0 limitation.  It does not apply to RNG, where
representing a choice between an element and an attribute is trivial.
I don't know if it applies to XSD 1.1 or not.  It does not apply to
Schematron either, where everything that is not forbidden is permitted.

There is a more general point: it's not always possible in any schema
language to represent the exact specification, and applications may need
to do further validation of the input.

LEAR: Dost thou call me fool, boy?      John Cowan
FOOL: All thy other titles              http://www.ccil.org/~cowan
             thou hast given away:      cowan@ccil.org
      That thou wast born with.

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS