I have an xml document of this sort of format:
<Collections>
<Collection>
<CollectionName>ASDF</CollectionName>
<Items>
<Item>
<Assets>
<Asset>
<AssetName>something</AssetName>
<AssetType>Anything</AssetType>
</Asset>
<Asset>
<AssetName>anything</AssetName>
<AssetType>something</AssetType>
</Asset>
</Assets>
<Item>
</Items>
</Collection>
.
.
.
</Collections>
This is a cut down version of the full XMl file, but this is the bit that is causing problems
I am writing a DTD for this XML file and was wondering how i specify the Assets section. This is what i have so far:
<!ELEMENT Collections (Collection*)>
<!ELEMENT Collection (CollectionName, Items)>
<!ELEMENT CollectionName (#PCDATA)>
<!ELEMENT Items (Item*)>
<!ELEMENT Item (Assets)>
<!ELEMENT Assets (Asset*)>
<!ELEMENT Asset (AssetName, AssetType)>
<!ELEMENT AssetName (#PCDATA)>
<!ELEMENT AssetType (#PCDATA)>
Like i said this is a cut down version of the document there are more elements in the item, assets and collection nodes than are here but this illustrates my point.
Is this the correct way of specifying a DTD for this XML structure?
any help appreciated.
<Collections>
<Collection>
<CollectionName>ASDF</CollectionName>
<Items>
<Item>
<Assets>
<Asset>
<AssetName>something</AssetName>
<AssetType>Anything</AssetType>
</Asset>
<Asset>
<AssetName>anything</AssetName>
<AssetType>something</AssetType>
</Asset>
</Assets>
<Item>
</Items>
</Collection>
.
.
.
</Collections>
This is a cut down version of the full XMl file, but this is the bit that is causing problems
I am writing a DTD for this XML file and was wondering how i specify the Assets section. This is what i have so far:
<!ELEMENT Collections (Collection*)>
<!ELEMENT Collection (CollectionName, Items)>
<!ELEMENT CollectionName (#PCDATA)>
<!ELEMENT Items (Item*)>
<!ELEMENT Item (Assets)>
<!ELEMENT Assets (Asset*)>
<!ELEMENT Asset (AssetName, AssetType)>
<!ELEMENT AssetName (#PCDATA)>
<!ELEMENT AssetType (#PCDATA)>
Like i said this is a cut down version of the document there are more elements in the item, assets and collection nodes than are here but this illustrates my point.
Is this the correct way of specifying a DTD for this XML structure?
any help appreciated.