Re: [xml] <!ELEMET declarations
- From: Daniel Veillard <veillard redhat com>
- To: "Morten W. J." <morten newtec dk>
- Cc: xml gnome org
- Subject: Re: [xml] <!ELEMET declarations
- Date: Mon, 30 May 2005 04:43:12 -0400
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/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]