1
我看到以下简单的XML。XML节点值和XML节点属性的差异和用法最佳实践
<?xml version="1.0"?>
<customers>
<customer ID="C001">
<name>Acme Inc.</name>
<phone>12345</phone>
</customer>
<customer ID="C002">
<name>Star Wars Inc.</name>
<phone>23456</phone>
</customer>
</customers>
我想知道为什么ID存储为属性而不是另一个内部节点?
有没有最好的实践或惯例呢?
节点值和节点属性有什么区别?
谢谢。
其实这应该可能是一个愚蠢的http://stackoverflow.com/questions/33746/xml-attribute-vs-xml-element –