# XMLDOM [![Build Status](https://secure.travis-ci.org/bigeasy/xmldom.png?branch=master)](http://travis-ci.org/bigeasy/xmldom) [![Coverage Status](https://coveralls.io/repos/bigeasy/xmldom/badge.png?branch=master)](https://coveralls.io/r/bigeasy/xmldom) [![NPM version](https://badge.fury.io/js/xmldom.png)](http://badge.fury.io/js/xmldom)
A JavaScript implementation of W3C DOM for Node.js, Rhino and the browser. Fully
compatible with `W3C DOM level2`; and some compatible with `level3`. Supports
`DOMParser` and `XMLSerializer` interface such as in browser.
Install:
-------
>npm install xmldom
Example:
====
```javascript
var DOMParser = require('xmldom').DOMParser;
var doc = new DOMParser().parseFromString(
'<xml xmlns="a" xmlns:c="./lite">\n'+
'\t<child>test</child>\n'+
'\t<child></child>\n'+
'\t<child/>\n'+
'</xml>'
,'text/xml');
doc.documentElement.setAttribute('x','y');
doc.documentElement.setAttributeNS('./lite','c:x','y2');
var nsAttr = doc.documentElement.getAttributeNS('./lite','x')
console.info(nsAttr)
console.info(doc)
```
API Reference
=====
* [DOMParser](https://developer.mozilla.org/en/DOMParser):
```javascript
parseFromString(xmlsource,mimeType)
```
* **options extension** _by xmldom_(not BOM standard!!)
```javascript
//added the options argument
new DOMParser(options)
//errorHandler is supported
new DOMParser({
/**
* locator is always need for error position info
*/
locator:{},
/**
* you can override the errorHandler for xml parser
* @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
*/
errorHandler:{warning:function(w){console.warn(w)},error:callback,fatalError:callback}
//only callback model
//errorHandler:function(level,msg){console.log(level,msg)}
})
```
* [XMLSerializer](https://developer.mozilla.org/en/XMLSerializer)
```javascript
serializeToString(node)
```
DOM level2 method and attribute:
------
* [Node](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247)
attribute:
nodeValue|prefix
readonly attribute:
nodeName|nodeType|parentNode|childNodes|firstChild|lastChild|previousSibling|nextSibling|attributes|ownerDocument|namespaceURI|localName
method:
insertBefore(newChild, refChild)
replaceChild(newChild, oldChild)
removeChild(oldChild)
appendChild(newChild)
hasChildNodes()
cloneNode(deep)
normalize()
isSupported(feature, version)
hasAttributes()
* [DOMImplementation](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-102161490)
method:
hasFeature(feature, version)
createDocumentType(qualifiedName, publicId, systemId)
createDocument(namespaceURI, qualifiedName, doctype)
* [Document](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#i-Document) : Node
readonly attribute:
doctype|implementation|documentElement
method:
createElement(tagName)
createDocumentFragment()
createTextNode(data)
createComment(data)
createCDATASection(data)
createProcessingInstruction(target, data)
createAttribute(name)
createEntityReference(name)
getElementsByTagName(tagname)
importNode(importedNode, deep)
createElementNS(namespaceURI, qualifiedName)
createAttributeNS(namespaceURI, qualifiedName)
getElementsByTagNameNS(namespaceURI, localName)
getElementById(elementId)
* [DocumentFragment](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-B63ED1A3) : Node
* [Element](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-745549614) : Node
readonly attribute:
tagName
method:
getAttribute(name)
setAttribute(name, value)
removeAttribute(name)
getAttributeNode(name)
setAttributeNode(newAttr)
removeAttributeNode(oldAttr)
getElementsByTagName(name)
getAttributeNS(namespaceURI, localName)
setAttributeNS(namespaceURI, qualifiedName, value)
removeAttributeNS(namespaceURI, localName)
getAttributeNodeNS(namespaceURI, localName)
setAttributeNodeNS(newAttr)
getElementsByTagNameNS(namespaceURI, localName)
hasAttribute(name)
hasAttributeNS(namespaceURI, localName)
* [Attr](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-637646024) : Node
attribute:
value
readonly attribute:
name|specified|ownerElement
* [NodeList](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177)
readonly attribute:
length
method:
item(index)
* [NamedNodeMap](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1780488922)
readonly attribute:
length
method:
getNamedItem(name)
setNamedItem(arg)
removeNamedItem(name)
item(index)
getNamedItemNS(namespaceURI, localName)
setNamedItemNS(arg)
removeNamedItemNS(namespaceURI, localName)
* [CharacterData](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-FF21A306) : Node
method:
substringData(offset, count)
appendData(arg)
insertData(offset, arg)
deleteData(offset, count)
replaceData(offset, count, arg)
* [Text](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1312295772) : CharacterData
method:
splitText(offset)
* [CDATASection](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-667469212)
* [Comment](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1728279322) : CharacterData
* [DocumentType](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-412266927)
readonly attribute:
name|entities|notations|publicId|systemId|internalSubset
* Notation : Node
readonly attribute:
publicId|systemId
* Entity : Node
readonly attribute:
publicId|systemId|notationName
* EntityReference : Node
* ProcessingInstruction : Node
attribute:
data
readonly attribute:
target
DOM level 3 support:
-----
* [Node](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent)
attribute:
textContent
method:
isDefaultNamespace(namespaceURI){
lookupNamespaceURI(prefix)
DOM extension by xmldom
---
* [Node] Source position extension;
attribute:
//Numbered starting from '1'
lineNumber
//Numbered starting from '1'
columnNumber
没有合适的资源?快使用搜索试试~ 我知道了~
世博展会微信小程序源码+截图
共199个文件
png:78个
js:41个
json:27个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 54 浏览量
2023-05-26
16:45:46
上传
评论
收藏 1.4MB RAR 举报
温馨提示
世博展会微信小程序源码+截图
资源推荐
资源详情
资源评论
收起资源包目录
世博展会微信小程序源码+截图 (199个子文件)
changelog 496B
strophe.js 241KB
connection.js 88KB
dom.js 36KB
utils.js 29KB
chatroom.js 26KB
sax.js 23KB
app.js 11KB
dom-parser.js 9KB
message.js 9KB
WebIM.js 8KB
PublishDynamic.js 5KB
queue.js 4KB
Communicate.js 4KB
status.js 4KB
ExhibitorsList.js 4KB
ProductRelease.js 3KB
ExhibitorInfo.js 3KB
Mine.js 3KB
EditProduct.js 3KB
chat.js 2KB
ExhibitorSearchResult.js 2KB
MyProdiction.js 2KB
WebIMConfig.js 2KB
ProductionSearchResult.js 2KB
ShowDetail.js 2KB
SystemMessage.js 2KB
MyDynamics.js 2KB
Home.js 2KB
ProdictionDetail.js 2KB
gulpfile.js 1KB
login.js 1KB
SystemMessageDetail.js 1KB
FadeBack.js 1KB
ModifyInfo.js 950B
FadeBackSuccess.js 913B
util.js 460B
logs.js 266B
__package__.js 201B
test.js 90B
index.js 45B
index.js 44B
package.json 3KB
app.json 2KB
package.json 769B
component.json 142B
login.json 128B
Home.json 100B
SystemMessage.json 95B
MyDynamics.json 95B
MyProdiction.json 95B
EditProduct.json 95B
ProductRelease.json 95B
FadeBack.json 95B
ModifyInfo.json 95B
SystemMessageDetail.json 95B
FadeBackSuccess.json 95B
ExhibitorsList.json 95B
ShowDetail.json 95B
ProdictionDetail.json 95B
ExhibitorSearchResult.json 95B
ProductionSearchResult.json 95B
ExhibitorInfo.json 95B
PublishDynamic.json 95B
chat.json 92B
chatroom.json 92B
Communicate.json 92B
Mine.json 89B
logs.json 54B
LICENSE 143B
readme.md 6KB
README.md 169B
.npmignore 37B
list.png 29KB
logo.png 11KB
del.png 7KB
shouye.png 6KB
jiaoliu.png 6KB
settings.png 5KB
wo.png 5KB
wode_Mess@3x.png 4KB
chatsActive2.png 4KB
contacts.png 4KB
settingsActive.png 4KB
buttonVideo.png 4KB
chat-list.png 4KB
buttonChat.png 4KB
buttonCall.png 3KB
contactsActive.png 3KB
wode_Mess@2x.png 3KB
default.png 3KB
chatsActive.png 3KB
chats.png 2KB
ee_29.png 2KB
ee_4.png 2KB
ee_16.png 2KB
ee_30.png 2KB
ee_12.png 2KB
ee_9.png 2KB
ee_5.png 2KB
共 199 条
- 1
- 2
资源评论
蒙奇·D·路飞-
- 粉丝: 5879
- 资源: 406
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功