Ryan's District Boards

Computer, programming, and webmaster help , support , tips and tricks => Tutorials Zone! => Internet webmaster computer programming technology tips and tricks => XML Tutorials => Topic started by: ben2ong2 on October 05, 2006, 04:59:55 PM

Title: XML Attribute Values Must be Quoted
Post by: ben2ong2 on October 05, 2006, 04:59:55 PM
With XML, it is illegal to omit quotation marks around attribute values.
XML elements can have attributes in name/value pairs just like in HTML. In XML the attribute value must always be quoted. Study the two XML documents below. The first one is incorrect, the second is correct:
<?xml version="1.0" encoding="ISO-8859-1"?><note date=12/11/2002><to>Tove</to><from>Jani</from></note>

<?xml version="1.0" encoding="ISO-8859-1"?><note date="12/11/2002"><to>Tove</to><from>Jani</from></note>

The error in the first document is that the date attribute in the note element is not quoted.
This is correct: date="12/11/2002". This is incorrect: date=12/11/2002.