microsoft.xmldom

XMLDOM 参考

 

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

  1. 简介
    XMLDOM 被设计为可用于任何语言和任何操作系统。借助 DOM,程序员可以创建 XML 文档、遍历其结构,增、改、删其元素。DOM 将整个 XML 文档视作一棵树,文档级的元素是树的根。
  2. MS 的 XML 解析,IE 5.0 以上是一个 COM 组件,至少包含下列对象:
    1. Micosoft.XMLDOM
    2. Micosoft.XMLDOM.parseError
      属性
      PropertyDescription
      errorCodeReturns a long integer error code
      reasonReturns a string explaining the reason for the error
      lineReturns a long integer representing the line number for the error
      linePosReturns a long integer representing the line position for the error
      srcTextReturns a string containing the line that caused the error
      urlReturns the url pointing the loaded document
      filePosReturns a long integer file position of the error
    3. Microsoft.XMLHTTP
      属性
      PropertyDescription
      readyStateReturns the state of the document
      responseBodyReturns the response as an array of unsigned bytes
      responseStreamReturns the response as an IStream
      responseTextReturns the response as a string
      responseXMLReturns the response as an xml document
      statusReturns the status code as a number
      statusTextReturns the status as a string
      方法
      PropertyDescription
      abort()Cancel the current http request
      getAllResponseHeaders()Returns the value of the http headers
      getResponseHeader(headerName)Returns the value of one specified http header
      open(method,url,async,userid,password)Opens http request, and specifies the information
      send()Send the http request to the server
      setRequestHeader(headerName,headerValue)Specifies the name of a http header
    4. Node 的类型
      类型
      nodeTypeNamed ConstantnodeTypeStringnodeNamenodeValue
      1ELEMENT_NODEelementtagNamenull
      2ATTRIBUTE_NODEattributenamevalue
      3TEXT_NODEtext#textcontent of node
      4CDATA_SECTION_NODEcdatasection#cdata-sectioncontent of node
      5ENTITY_REFERENCE_NODEentityreferenceentity reference namenull
      6ENTITY_NODEentityentity namenull
      7PROCESSING_INSTRUCTION_NODEprocessinginstructiontargetcontent of node
      8COMMENT_NODEcomment#commentcomment text
      9DOCUMENT_NODEdocument#documentnull
      10DOCUMENT_TYPE_NODEdocumenttypedoctype namenull
      11DOCUMENT_FRAGMENT_NODEdocumentfragment#document fragmentnull
      12NOTATION_NODEnotationnotation namenull
      W3C规定的属性
      PropertyDescription
      attributesReturns a NamedNodeMap containing all attributes for this node
      childNodesReturns a NodeList containing all the child nodes for this node
      firstChildReturns the first child node for this node
      lastChildReturns the last child node for this node
      nextSiblingReturns the next sibling node. Two nodes are siblings if they have the same parent node
      nodeNameReturns the nodeName, depending on the type
      nodeTypeReturns the nodeType as a number
      nodeValueReturns, or sets, the value of this node, depending on the type
      ownerDocumentReturns the root node of the document
      parentNodeReturns the parent node for this node
      previousSiblingReturns the previous sibling node. Two nodes are siblings if they have the same parent node
      W3C规定的方法
      MethodDescription
      appendChild(newChild)Appends the node newChild at the end of the child nodes for this node
      cloneNode(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 well
      hasChildNodes()Returns true if this node has any child nodes
      insertBefore(newNode,refNode)Inserts a new node, newNode, before the existing node, refNode
      removeChild(nodeName)Removes the specified node, nodeName
      replaceChild(newNode,oldNode)Replaces the oldNode, with the newNode
    5. NodeList 的 W3C 规定的属性和方法
      属性
      PropertyDescription
      lengthReturns the number of nodes in a nodeList
      方法
      MethodDescription
      itemReturns a specific node in the nodeList

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值