在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
http://msdn.microsoft.com/zh-cn/library/vstudio/hf9hbf87.aspx
<?xml version="1.0"?> <books> <book> <author>Carson</author> <price format="dollar">31.95</price> <pubdate>05/01/2001</pubdate> </book> <pubinfo> <publisher>MSPress</publisher> <state>WA</state> </pubinfo> </books>
XmlDocument 类(扩展XmlNode)支持用于对整个文档执行操作(例如,将文档加载到内存中或将 XML 保存到文件中)的方法。 XmlNode 和 XmlDocument 都具有性能和可用性增强,并通过方法和属性执行下列操作:
其中的某些特性包括:
属性被视为元素节点的属性,由名称和值对组成。 dollar。 有关更多信息,请参见访问 DOM 中的属性。
http://linder0209.iteye.com/blog/1458823 http://www.css88.com/archives/5017
(一)nodeName 属性含有某个节点的名称。
元素节点的 nodeName 是标签名称 属性节点的 nodeName 是属性名称 文本节点的 nodeName 永远是 #text 文档节点的 nodeName 永远是 #document 注释:nodeName 所包含的 XML 元素的标签名称永远是 大写 的
nodeName 属性含有某个节点的名称。
(二)nodeValue 对于文本节点,nodeValue 属性包含文本。 对于属性节点,nodeValue 属性包含属性值。 nodeValue 属性对于文档节点 <document> 和元素节点 <element> 是不可用的。
(三)nodeType nodeType 属性可返回节点的类型。 最重要的节点类型是: 元素类型 节点类型 元素element 1 属性attr 2 文本text 3 注释comments 8 文档document 9
http://www.w3schools.com/dom/dom_nodetype.asp Node TypesThe following table lists the different W3C node types, and which node types they may have as children:
Node Types - Return ValuesThe following table lists what the nodeName and the nodeValue properties will return for each node type:
NodeTypes - Named Constants
http://www.w3school.com.cn/xmldom/dom_nodes_nodelist.asp <bookstore> <book category="children"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="cooking"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="web" cover="paperback"> <title lang="en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book> <book category="web"> <title lang="en">XQuery Kick Start</title> <author>James McGovern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49.99</price> </book> </bookstore> 下面的图像表示 "books.xml" 中 <title> 元素的节点列表:
Xml.XMLIntf.IXMLNode.NodeTypeIndicates the type of the node. Read NodeType to determine the type of the node. The type reflects the way the node is used in the XML document. TNodeType = (
ntReserved,
ntElement,
ntAttribute,
ntText,
ntCData,
ntEntityRef,
ntEntity,
ntProcessingInstr,
ntComment,
ntDocument,
ntDocType,
ntDocFragment,
ntNotation);
Xml.XMLIntf.IXMLNode.NodeNameIndicates the node name. NodeName is the name of the underlying DOM node. The node's name depends on the type of the node, as indicated in the following table:
Xml.XMLIntf.IXMLNode.NodeValueSpecifies the value of this node. Use NodeValue to get or set the value of the node. The meaning of a node's value depends on the type of the node, as indicated in the following table:
Xml.XMLIntf.IXMLNode.IsTextElementIndicates whether the node has a single text value. Read IsTextElement to determine whether this node represents a single text value. For example, if the node represents the following:
<Title> Understanding XML </Title> IsTextElement is true, because the node represents a tagged element and the text that is its value. Note: In the underlying DOM implementation, nodes for which IsTextElement is true are element nodes that have a single child node that is a text node. IXMLNode flattens this out so that you can use the element node to work with the text value (through the Text property), rather than requiring you to use a separate node for the text value.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论