<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
文档的第一行--XML声明---定义XML的版本和文档所用字体的编码.
第二行,描述了文档的根元素.
接下来的四行描述了根元素的四个子元素(to,from,heading,body)
最后一行定义了根元素的结尾.
xml中所有的元素都必须有结束标签.xml标签是区分大小写的.
<to>和<To>是不同的标签.
xml元素必须合理嵌套.
xml文档必须有一个根元素.
xml属性值必须被引号引起来.
<?xml version="1.0" encoding="ISO-8859-1"?>
<note date="12/11/2002">
<to>Tove</to>
<from>Jani</from>
</note>
xml中的注释:
<!-- This is a comment -->