Hi there, I'm new to writing XML (just a couple of weeks old) so please bear with me.
I was wondering when it would be the right time to use PCDATA in the DTD. I think there are another two data types? CDATA and ANY?
It says on this website that the difference between the two DATA ones is for parsing and I'm sure sure if in this context that thats what I'd like to do.
This is what I've got at the moment:
I'm in the process of validating it but haven't quite finished doing so. Please let me know if what i've got so far is looking right. All suggestions and feedback is appreciated! =)
I was wondering when it would be the right time to use PCDATA in the DTD. I think there are another two data types? CDATA and ANY?
It says on this website that the difference between the two DATA ones is for parsing and I'm sure sure if in this context that thats what I'd like to do.
This is what I've got at the moment:
Code:
<?xml version="1.0"?>
<!DOCTYPE inventory [
<!ELEMENT inventory (vehicle?)>
<!ELEMENT vehicle (make, model, km, descr?, photo+)>
<!ELEMENT make (#PCDATA)>
<!ELEMENT model (#PCDATA)>
<!ATTLIST model year ID #REQUIRED>
<!ELEMENT km (#PCDATA)>
<!ATTLIST km usagetype (private | business) #REQUIRED>
<!ELEMENT descr (bodytype, colour)>
<!ATTLIST vehicle rego ID #REQUIRED>
]>
<inventory>
<vehicle rego="__">
<make></make>
<model year="__"></model>
<km usagetype="___"></km>
<descr>
<bodytype></bodytype>
<colour></colour>
</descr>
<photo></photo>
</vehicle>
</inventory>
Comment