On Mon, May 30, 2005 at 09:45:28AM +0200, Morten W. J. wrote: > child elements and about wildcards and grouping. Eg. > <!ELEMENT node (a, b, c, d)* > > However I cannot find a way to define it so that, in the example above > element "node" is allowed exactely one a, one b, one c and one d sub element > but in arbitrary order! Of cause I could construct all possible combinatins > and OR them, but in my real DTD i have around 40000 combinations a couple of > times. > Exists there a language construct for that purpose?
At the DTD level, no. In Schemas you have xsd:all for this. In Relax-NG there is the interleave construct. > 2. Is there a way to copule a attribute definition together with a element > declaration? That is, i would like to define that element "node" must have > attribute "type" with a value from a enumeration, and depending on the value > of "type" a specific ELEMENT declaration shall be selected. For example: > You can't do that in DTD or Schemas. This is possible by building a choice with two branches one with the attribute and one without in Relax-NG. Daniel -- Daniel Veillard | Red Hat Desktop team http://redhat.com/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
