[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RELAX NG require oneOrMore optional elements
Is it possible to require one or more from a list of optional elements? If I have something like: <element name="parent"> <oneOrMore> <interleave> <optional> <element name="child1"> <text/> </element> </optional> <optional> <element name="child2"> <text/> </element> </optional> </interleave> </oneOrMore> </element> My intent is that <parent> must have at least 1 of the child elements. But python-lxml (which I guess is libxml2) doesn't flag <parent /> as erroneous. Note that my actual list of child elements is quite long. I also tried <oneOrMore><choice>...</choice></oneOrMore> and removing all the <optional> wrappers. This does require that at least one child be present but doesn't prevent repetition of child elements. I thought about adding xsd:maxOccurrence attributes to each child element but I'm not sure how to get the RelaxNG parser to understand them. -frank
[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
|