XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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] RELAX question re: required value



On Wed, Jan 22, 2014 at 11:30 AM, Michael Sokolov <msokolov@safaribooksonline.com> wrote:

I have a schema that allows a bunch of different elements to be interleaved in any order; one of them is <collection>;  I want to require that a collection with value "all" be present, as well as allowing any number of other collections, in any order, using RELAX -- is that possible? 
 
No, it isn't.  It would have to be element collection {"all"} & element collection {text}, and it is forbidden to have the same element name on both sides of &.  This is one of the few arbitrary restrictions in RNG.  Even that formulation, if it were legal, would allow more than one "all" collection, since there is no way to say "everything but 'all'" in RNG.

However, this is a perfect application for an embedded Schematron rule asserting that count(collection[text() = "all"] = 1.  Jing supports embedded Schematron 1.5 rules quite nicely.

--
GMail doesn't have rotating .sigs, but you can see mine at http://www.ccil.org/~cowan/signatures


[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