[xml] <!ELEMET declarations



Hi all.

Please excuse me if this is too off topic, but you all seem so enlightend to 
me ;-)

1. I know how to define an elements so that an element may contain a number of 
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?

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: 

<!ATTLIST node type (a|b) #REQUIRED>

and if the value of "type" is "a" 

<!ELEMENT node ( aa, aaa, aaaa )* >

shall be used for validation

butif the value of "type" is "b" 

<!ELEMENT node ( bb, bbb, bbbb )* >

shall be used for validation

Exists such a construct?


Thank you in advance.

-- 
Morten W. Jørgensen

Newtec A/S
StærmosegÂrdsvej 18
5230 Odense M
Denmark
Tlf.: 66 15 84 44



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