XMLDOM及XMLHTTP学习手册
2004-08-24 13:17
288 查看
XMLDOM学习笔记
XMLDOM是用来访问和操作XML文档的编程接口规范。1、简介
XMLDOM被设计为可用于任何语言和任何操作系统。借助DOM,程序员可以创建XML文档、遍历其结构,增、改、删其元素。DOM将整个XML文档视作一棵树,文档级的元素是树的根。
2、MS的XML解析,IE5.0以上。
是一个COM组件,至少包含下列对象:
(1)Micosoft.XMLDOM
(2)Micosoft.XMLDOM.parseError,有如下属性:
Property | Description |
errorCode | Returns a long integer error code |
reason | Returns a string explaining the reason for the error |
line | Returns a long integer representing the line number for the error |
linePos | Returns a long integer representing the line position for the error |
srcText | Returns a string containing the line that caused the error |
url | Returns the url pointing the loaded document |
filePos | Returns a long integer file position of the error |
Property | Description |
readyState | Returns the state of the document |
responseBody | Returns the response as an array of unsigned bytes |
responseStream | Returns the response as an IStream |
responseText | Returns the response as a string |
responseXML | Returns the response as an xml document |
status | Returns the status code as a number |
statusText | Returns the status as a string |
Property | Description |
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 |
nodeType | Named Constant | nodeTypeString | nodeName | nodeValue |
---|---|---|---|---|
1 | ELEMENT_NODE | element | tagName | null |
2 | ATTRIBUTE_NODE | attribute | name | value |
3 | TEXT_NODE | text | #text | content of node |
4 | CDATA_SECTION_NODE | cdatasection | #cdata-section | content of node |
5 | ENTITY_REFERENCE_NODE | entityreference | entity reference name | null |
6 | ENTITY_NODE | entity | entity name | null |
7 | PROCESSING_INSTRUCTION_NODE | processinginstruction | target | content of node |
8 | COMMENT_NODE | comment | #comment | comment text |
9 | DOCUMENT_NODE | document | #document | null |
10 | DOCUMENT_TYPE_NODE | documenttype | doctype name | null |
11 | DOCUMENT_FRAGMENT_NODE | documentfragment | #document fragment | null |
12 | NOTATION_NODE | notation | notation name | null |
Property | Description |
---|---|
attributes | Returns a NamedNodeMap containing all attributes for this node |
childNodes | Returns a NodeList containing all the child nodes for this node |
firstChild | Returns the first child node for this node |
lastChild | Returns the last child node for this node |
nextSibling | Returns the next sibling node. Two nodes are siblings if they have the same parent node |
nodeName | Returns the nodeName, depending on the type |
nodeType | Returns the nodeType as a number |
nodeValue | Returns, or sets, the value of this node, depending on the type |
ownerDocument | Returns the root node of the document |
parentNode | Returns the parent node for this node |
previousSibling | Returns the previous sibling node. Two nodes are siblings if they have the same parent node |
Method | Description |
---|---|
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 |
Property | Description |
---|---|
length | Returns the number of nodes in a nodeList |
Method | Description |
---|---|
item | Returns a specific node in the nodeList |
相关文章推荐
- 【ASM的学习】asm官方手册学习心得01
- Redis学习手册(主从复制)
- 拓幻科技图形学工程师教学手册(第四讲)|一字一字敲出OpenGL学习教程
- Javascript正则表达式完全学习手册
- Git学习系列(五)——Egit使用手册
- Redis学习手册(Set数据类型)
- Redis学习手册--持久化机制
- Maven——快速入门手册(学习记录)****
- 阿里巴巴java开发手册学习
- PostgreSQL学习手册
- Redis学习手册(内存优化)
- Genesis-3D学习手册——9.使用组件
- Linux命令学习手册-rsync命令
- 我们编程吧 之 C++学习手册v0.1
- Git版本控制软件结合GitHub从入门到精通常用命令学习手册(转)
- GIT 学习手册简介
- Bash学习手册
- PostgreSQL学习手册(客户端命令<二>)
- 我的python学习手册1
- Django 手册 学习 心得 笔记