News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

XML Attribute Values Must be Quoted

Started by ben2ong2, October 05, 2006, 04:59:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ben2ong2

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.
You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login