IBM网站上给出的XML的介绍(5)不完全摘录
Attributes must have quoted values
Page 7 of 10
所有的attributes 必须是--------有属性值并且是用“”把属性值括起来
There are two rules for attributes in XML documents:
[*]Attributes must have values
[*]Those values must be enclosed within quotation marks
Compare the two examples below. The markup at the top is legal in HTML, but not in XML. To do the equivalent in XML, you have to give the attribute a value, and you have to enclose it in quotes.
<!-- NOT legal XML markup -->
<ol compact>
<!-- legal XML markup -->
<ol compact="yes">
You can use either single or double quotes, just as long as you're consistent.
If the value of the attribute contains a single or double quote, you can use the other kind of quote to surround the value (as in name="Doug's car"), or use the entities " for a double quote and ' for a single quote. An entity is a symbol, such as ", that the XML parser replaces with other text, such as ".
页:
[1]