注释应注意的问题: 1.注释不能出现在XML声明之前; 2.注释不能出现在标记中; 3.注释中不能出现连续两个连字符,即"--" 如:<!--this is a bad document.--do you know!-->; 4.注释中可包含元素,但元素中不能包含"--"包含的元素解析时被忽略; 5.注释不能嵌套; 四。元素与标记: 所有的XML元素必须合理包含,且所有的XML文档必须有一个根元素。如同HTML一样,XML元素同样也可以拥有属性。XML元素的属性以名字/值成对的出现。XML语法规范要求XML元素属性值必须用引号引着。请看下面的两个例子,第一个是错误的,第二个是正确的。
attributes cannot contain multiple values (child elements can) (属性不能包含多个值(子元素可以))
attributes are not easily expandable (for future changes) (属性不容易扩展)
attributes cannot describe structures (child elements can) (属性不能够描述结构(子元素可以))
attributes are more difficult to manipulate by program code (属性很难被程序代码处理)
attribute values are not easy to test against a Document Type Definition (DTD) - which is used to define the legal elements of an XML document(属性值很难通过DTD进行测试)