Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I declare Non-sequential children elements?

Status
Not open for further replies.

Graywolf001

Programmer
Oct 26, 2001
7
US
Hey all.
First, let me say that I'm a total DTD newbie. However, I felt that DTD's were better suited for certain error validation than programmatic means on the site I'm currently building.

The problem is, I need to explicitly declare every element returned to me in an XML doc. However, I can't guarantee the sequence of the returned elements in each parent node. Is there a way to declare each child node inside the parenthesis after the parent node without declaring that they appear in the sequence listed? E.G.:

<!ELEMENT PINS (PIN+,PIN2+)>
<!ATTLIST PINS Index CDATA &quot;&quot;>
<!ELEMENT PIN (#PCDATA)>
<!ELEMENT PIN2 (#PCDATA)>
<!-- This will declare that <PIN> must come BEFORE <PIN2>-->

<!-- The XML could be sorted by in both of these manners tho -->
<PINS Index=&quot;1&quot;>
<PIN>1234</PIN>
<PIN2>1234</PIN2>
</PINS>
<PINS Index=&quot;2&quot;>
<PIN2>4321</PIN2>
<PIN>4321</PIN>
</PINS>

I don't get the necessary validation using &quot;ANY&quot; instead of declaring the child nodes,

Any help would be MUCH appreciated!

Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top