microsoft.xmldom

来源:互联网 发布:服务器装centos系统 编辑:程序博客网 时间:2024/04/29 15:47

XMLDOM 参考

 

XMLDOM 是用来访问和操作XML文档的编程接口规范。

  1. 简介
    XMLDOM 被设计为可用于任何语言和任何操作系统。借助 DOM,程序员可以创建 XML 文档、遍历其结构,增、改、删其元素。DOM 将整个 XML 文档视作一棵树,文档级的元素是树的根。
  2. MS 的 XML 解析,IE 5.0 以上是一个 COM 组件,至少包含下列对象:
    1. Micosoft.XMLDOM
    2. Micosoft.XMLDOM.parseError 属性PropertyDescriptionerrorCodeReturns a long integer error codereasonReturns a string explaining the reason for the errorlineReturns a long integer representing the line number for the errorlinePosReturns a long integer representing the line position for the errorsrcTextReturns a string containing the line that caused the errorurlReturns the url pointing the loaded documentfilePosReturns a long integer file position of the error
    3. Microsoft.XMLHTTP 属性PropertyDescriptionreadyStateReturns the state of the documentresponseBodyReturns the response as an array of unsigned bytesresponseStreamReturns the response as an IStreamresponseTextReturns the response as a stringresponseXMLReturns the response as an xml documentstatusReturns the status code as a numberstatusTextReturns the status as a string方法PropertyDescriptionabort()Cancel the current http requestgetAllResponseHeaders()Returns the value of the http headersgetResponseHeader(headerName)Returns the value of one specified http headeropen(method,url,async,userid,password)Opens http request, and specifies the informationsend()Send the http request to the serversetRequestHeader(headerName,headerValue)Specifies the name of a http header
    4. Node 的类型 类型nodeTypeNamed ConstantnodeTypeStringnodeNamenodeValue1ELEMENT_NODEelementtagNamenull2ATTRIBUTE_NODEattributenamevalue3TEXT_NODEtext#textcontent of node4CDATA_SECTION_NODEcdatasection#cdata-sectioncontent of node5ENTITY_REFERENCE_NODEentityreferenceentity reference namenull6ENTITY_NODEentityentity namenull7PROCESSING_INSTRUCTION_NODEprocessinginstructiontargetcontent of node8COMMENT_NODEcomment#commentcomment text9DOCUMENT_NODEdocument#documentnull10DOCUMENT_TYPE_NODEdocumenttypedoctype namenull11DOCUMENT_FRAGMENT_NODEdocumentfragment#document fragmentnull12NOTATION_NODEnotationnotation namenullW3C规定的属性PropertyDescriptionattributesReturns a NamedNodeMap containing all attributes for this nodechildNodesReturns a NodeList containing all the child nodes for this nodefirstChildReturns the first child node for this nodelastChildReturns the last child node for this nodenextSiblingReturns the next sibling node. Two nodes are siblings if they have the same parent nodenodeNameReturns the nodeName, depending on the typenodeTypeReturns the nodeType as a numbernodeValueReturns, or sets, the value of this node, depending on the typeownerDocumentReturns the root node of the documentparentNodeReturns the parent node for this nodepreviousSiblingReturns the previous sibling node. Two nodes are siblings if they have the same parent nodeW3C规定的方法MethodDescriptionappendChild(newChild)Appends the node newChild at the end of the child nodes for this nodecloneNode(boolean)Returns an exact clone of this node. If the boolean value is set to true, the cloned node contains all the child nodes as wellhasChildNodes()Returns true if this node has any child nodesinsertBefore(newNode,refNode)Inserts a new node, newNode, before the existing node, refNoderemoveChild(nodeName)Removes the specified node, nodeNamereplaceChild(newNode,oldNode)Replaces the oldNode, with the newNode
    5. NodeList 的 W3C 规定的属性和方法 属性PropertyDescriptionlengthReturns the number of nodes in a nodeList方法MethodDescriptionitemReturns a specific node in the nodeList