I have the following basic XML and DTD:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE items [
<!ELEMENT items (item*)>
<!ELEMENT item (name, age*)>
<!ATTLIST item id ID #IMPLIED>
<!ELEMENT name (#PCDATA)>
<!ELEMENT age (#PCDATA)>
]>
<items>
<item id="1">
<name>Tom</name>
<age>20</age>
</item>
<item id="2">
<name>mike</name>
<age>20</age>
</item>
<item id="3">
<name>erik</name>
<age>20</age>
</item>
</items>
This validates if I change ATTLIST item id ID to ATTLIST item id CDATA, but currently I get the following error:
What's the issue here with the ID field? How should this be used properly?
