Re: 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 [snip] > 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: email@example.com That thou wast born with.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format