Re: [xml] <!ELEMET declarations

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 
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 Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]