PDA

View Full Version : any XML guru's?



attgig
11-13-2002, 12:57 PM
need to learn xml for work, making a few documents...
question...

what's the diff between making a bunch of attributes for a element or instead of using attributes, just making them all elemenets?

for example, whats the diff between having something like:

<!ELEMENT name (first_name, last_name)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT last_name (#PCDATA)>

or having something like:
<!ELEMENT name (#PCDATA)>
<!ATTLIST name
first_name CDATA #REQUIRED
last_name CDATA #REQUIRED >

???

skynet
11-13-2002, 08:57 PM
Attribute values can contain any ASCII characters, including those normally reserved for markup. Because of this, attribute values are not designed to be parsable by an XML processor which means that attribute values cannot be validated. The processor will check to determine that an attribute name and value match the type that was declared in the DTD, but it will not care what the value is.