April 18, 2009

0 Attribute values must be quoted

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 one is correct:

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


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





Rasik
Bapotra







Rasik
Bapotra

0 comments:

Post a Comment

Blogger Themes

 
Powered by Blogger