Let's say I have the following XML:
<data>
<authors>
<author>
<name>
<first_name>Stephen</first_name>
<last_name>Baxter</last_name>
</name>
</author>
<author>
<name>
<first_name>Joe</first_name>
<last_name>Haldeman</last_name>
</name>
<author>
</authors>
<books>
<book>
<name>The Time Ships</name>
</book>
<book>
<name>The Forever War</name>
<book>
</books>
</data>
In my DTD, how would I explain that the "name" element is used for both authors and books and can have different child elements - like this?
<!ELEMENT name (#PCDATA|first_name,last_name)>
source
share