[JDEV] Quotes in XML
Peter Saint-Andre
stpeter at jabber.org
Sun Jun 3 21:20:07 CDT 2001
Michal Leinweber wrote:
>>The XML Spec (http://www.w3.org/TR/REC-xml) yields the following under
>>2.3 Common Syntactic Constructs (specifically, the "literals" subsection):
>>
>>AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] |
>>Reference)* "'"
>>
>>Notice that " and ' are both acceptable.
>>
>
> Sorry but there is nothing like your notice in that document ......!
Um, go to http://www.w3.org/TR/REC-xml#sec-common-syn and take a look at
item [10].
See also item D.2.1 in the XML FAQ at http://www.ucc.ie/xml/ which states:
"all attribute values must be in quotes (the single-quote character [the
apostrophe] may be used if the value contains a double-quote character,
and vice versa)"
In addition, the answer to Question 12 in the Perl XML FAQ at
http://www.perlxml.com/faq/perl-xml-faq.html states:
"NOTE: You can use single or double quotes for attribute values in the
XML declaration."
(This is true more generally, and does not apply only to the XML
declaration.)
Peter
More information about the JDev
mailing list