XML DOM的结构概念图解-哪里是Element,哪里是Attribute,哪里是Text
有段时间没接触XML了,近日做XML数据搜索,竟然发现自己晕在XML的各种概念里了,看来是把XML DOM的结构定义术语忘记得一干二净了。好记性不如烂笔头,还是把它摘出来为好。
实例XML文档内容:
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="">
<book id="bk101">
<author>Matthew</author>
<title>XML Developer</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>After an inadvertant </description>
</book>
<book id="bk109">
<author>Kress, Peter</author>
<title>Paradox Lost</title>
<genre>Science Fiction</genre>
<price>6.95</price>
<publish_date>2000-11-02</publish_date>
<description>James Salway discovers</description>
</book>
</catalog>
<catalog xmlns="">
<book id="bk101">
<author>Matthew</author>
<title>XML Developer</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>After an inadvertant </description>
</book>
<book id="bk109">
<author>Kress, Peter</author>
<title>Paradox Lost</title>
<genre>Science Fiction</genre>
<price>6.95</price>
<publish_date>2000-11-02</publish_date>
<description>James Salway discovers</description>
</book>
</catalog>
对应的概念术语:
对应的API接口(暂且这么称呼):
<book id="bk109"> </book> 就是 IXMLDOMNode
所有的<book> 就是 IXMLDOMNodeList
author、title、price 这些则是 IXMLDOMElement
author、title、price 的值则是 IXMLDOMText