Doug Estep
Usenet Archive
- Joined
- Feb 1, 2004
- Messages
- 2
- Reaction score
- 0
Below is a sample of my XML…
<MetaData>
<Table name="mytable">
<PrimaryKey name="pk"><Column name="mycolumn"/></PrimaryKey> </Table> </MetaData>
<Sequencer>
<Table name="mytable">
<Column name="mycolumn">
<Type>Object</Type>
</Column>
</Table>
</Sequencer>
Notice that I have two elements called, MetaData and Sequencer that both have child elements called Table. How do I define the Table child element in a DTD? Let me continue to explain what I mean. To define the DTD for the two parent elements, I would do the following…
<!ELEMENT MetaData (Table+)>
<!ELEMENT Sequencer(Table+)>
Now I want to define the Table elements for both the MetaData and the Sequencer elements. How do I do that when both child elements are named Table. This is valid XML. But I can't see how I can create a DTD for this XML when I can't define duplicate element names in a DTD.
I'm new to XML, so this may be a dumb question. I hope that it is, because if this cannot be done, then defining a DTD is a worthless exercise in any serious business application, in my opinion.
Your help is greatly appreciated. Please refrain from telling me how I can work around this by structuring my XML in another way. I know that I can do that. I am more interested in if it is possible to have two parent elements with child elements that have the same name and be able to define that in a DTD.
Thanks,
Doug
<MetaData>
<Table name="mytable">
<PrimaryKey name="pk"><Column name="mycolumn"/></PrimaryKey> </Table> </MetaData>
<Sequencer>
<Table name="mytable">
<Column name="mycolumn">
<Type>Object</Type>
</Column>
</Table>
</Sequencer>
Notice that I have two elements called, MetaData and Sequencer that both have child elements called Table. How do I define the Table child element in a DTD? Let me continue to explain what I mean. To define the DTD for the two parent elements, I would do the following…
<!ELEMENT MetaData (Table+)>
<!ELEMENT Sequencer(Table+)>
Now I want to define the Table elements for both the MetaData and the Sequencer elements. How do I do that when both child elements are named Table. This is valid XML. But I can't see how I can create a DTD for this XML when I can't define duplicate element names in a DTD.
I'm new to XML, so this may be a dumb question. I hope that it is, because if this cannot be done, then defining a DTD is a worthless exercise in any serious business application, in my opinion.
Your help is greatly appreciated. Please refrain from telling me how I can work around this by structuring my XML in another way. I know that I can do that. I am more interested in if it is possible to have two parent elements with child elements that have the same name and be able to define that in a DTD.
Thanks,
Doug