在XSD,SOAP和其他XML约定,你会经常看到像:XML:属性还是孩子?
<book>
<title>Harry Potter</title>
<author>J.K. Rowling</author>
</book>
现在我想知道,发生了什么属性?对我来说更有意义,写为:
<book title="Harry Potter" author="J.K. Rowling" />
但很显然,由于某些原因,聪明的人比我选择了其他方式。 有人可以解释为什么,以及什么属性呢?
请参阅: http://stackoverflow.com/questions/241819/xml-best-practices-attributes-vs-additional-nodes – Cuga 2009-05-05 14:37:46