Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Designing a recursive XML schema Designing a recursive XML schemaTo: NULL Date: 9/16/2008 8:38:00 PM I'm looking to define a particular kind of recursive XML Schema. It needs to describe the following kind of document: <nodes> <node> <name>Node 1</name> <item/> </node> <node> <name>Node 2</name> <nodes> <node> <item/> <name>Node 4</name> </node> </nodes> </node> <node> <name>Node 3</name> <item/> </node> </nodes> Key features of this document are: 1) nodes/node nesting can be to any (reasonable) depth. 2) All "node" elements must contain "a name elements " AND ("a nodes elements " OR "an item elements "). Or, to put it another way, it should not contain both a "node" and "item", but must have one of them - in addtion to the name element, which it also must have. 3). "name" elements can come before or after the "nodes" or "item" element (e.g. be in an xs:all compositor. Where I'm really struggling is in how to get the name and nodes OR items. Looks like I need an xs:all with an xs:choice underneath it, but that doesn't seem to be allowed. Help? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
