1
<nodes>
    <x><a/></x>
    <x><b/></x>
    <x><c/></x>
    <x><d/></x>
</nodes>

within <nodes> there should be a <x><a/></x> followed by a <x><b/></x> and <x><c/></x> and <x><d/></x> in that order.

I want the DTD to be sort of like this:

<!ELEMENT x (a|b|c|d)>
<!ELEMENT nodes (x(a),x(b),x(c),x(d))>

Is it possible for DTDs to specify the order of grandchild nodes?

Pacerier
  • 86,231
  • 106
  • 366
  • 634

1 Answers1

3

No, you can't specify the order of grandchildren. You're only defining the content model of the element you're declaring.

You'd be better off eliminating x:

<!ELEMENT nodes (a,b,c,d)>

XML:

<nodes>
  <a/>
  <b/>
  <c/>
  <d/>
</nodes>
Daniel Haley
  • 51,389
  • 6
  • 69
  • 95