ImageVerifierCode 换一换
格式:DOC , 页数:25 ,大小:339.50KB ,
资源ID:3737544      下载积分:20 文钱
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,省得不是一点点
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.wenke99.com/d-3737544.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(XML解析器.doc)为本站会员(11****ws)主动上传,文客久久仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知文客久久(发送邮件至hr@wenke99.com或直接QQ联系客服),我们立即给予删除!

XML解析器.doc

1、XML 解析器接口缩略语XML eXtensible Markup Language 可扩展的置标语言DOM Document Object Model,文档对象模型SAX Simple API for XML,简单的 XML APIJAXP Java API for XML Processing XML 的 Java 接口DTD Document Type Definition,文档对象定义XSL Extensible Stylesheet Language,可扩展样式语言可扩展标记语言 XML(eXtensible Markup Language)是标准通用标记语言 SGML 的子集,是互

2、联网上交换数据的标准。XML 文件包含了数据对象和处理这些数据对象的程序的描述。XML 文件在被浏览器显示出来或其他应用程序使用之前,经过了以下几个步骤:解析、样式表格式化、转换、数据库访问等。XML 解析器完成第一步工作,它读取 XML 文件,生成语法树,审查文档结构,将结果传给应用程序。XML 解析器可以是验证解析器,用以检查文件是否有效,也可以是非验证解析器,仅为结构良好的文件进行检查。应用程序可使用 C、Java 或 Jscript、VBscript、ASP 等脚本语言,通过解析器接口对XML 文件中的元素、属性、实体和标记进行操作。常见的 XML 解析器:1. MSXML,微软的 X

3、ML 解析器,与 W3C 规范不完全兼容。2. Xerces,开放源码组织提供,实现 Xerces 本地接口 XNI,支持的标准有:XML1.0、XML 命名空间、DOM2(Core, Events, and Traversal and Range)、SAX2( Core, and Extension) 、JAXP1.1 、XML Schema 1.0(Structures and Datatypes) 。Xerces 有 3 个版本,分别用 C+、java 和 perl 实现。应用程序可以链接 Xerces 库,调用其接口访问 XML 文档。3 XML4j、XML4c,IBM 对 Xerce

4、s 的扩展。XML4j 的 API 分为 3 类:Public:包括 DOM1、DOM2 接口,SAX1、SAX2 接口Experimental:包括 DOM3 接口Internal:内部接口DOM 接口:整个 XML 文档被视为具有层次关系的节点树,所有的非根节点都是以一个根节点为祖先遗传下来。例如这段文件,Shady GroveAeolian Over the River, Charlie Dorian DOM 将其看作下面这棵树,当然“树“的观念只是逻辑上的,协议的实现可以采用各种方式。对树进行深度优先前序遍历即可重现文档。DOM 中每一种节点类型都有一个相应的接口。DOM 的节点类型有

5、:Document、Element、Attr、Text、CDATASection、EntityReference、Entity、ProcessingInstruction、 Comment、DocumentType 、DocumentFragment、Notation。节点的包容关系:Document Element, ProcessingInstruction, Comment, DocumentTypeElement Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReferenceAttr Text,

6、EntityReferenceTextCDATASectionEntityReference Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReferenceEntity Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReferenceProcessinfInstructionCommentDocumentTypeDocumentFragment Element, ProcessingInstruction, Comme

7、nt, Text, CDATASection, EntityReferenceNotationDOM1 由两部分组成:Core DOM 和 HTML DOM。Core DOM 进一步被划分为基础接口和扩展接口,所有解析器都必须实现基础接口,如果只对 HTML 文档进行操作,则不需要实现扩展接口。HTML DOM 对 HTML 文档所特有的对象和方法进行描述,可参见相关规范,此处不详述。基础接口:DOMException 接口:exception DOMException unsigned short code;/ ExceptionCodeconst unsigned short INDEX_

8、SIZE_ERR = 1;const unsigned short DOMSTRING_SIZE_ERR = 2;const unsigned short HIERARCHY_REQUEST_ERR = 3;const unsigned short WRONG_DOCUMENT_ERR = 4;const unsigned short INVALID_CHARACTER_ERR = 5;const unsigned short NO_DATA_ALLOWED_ERR = 6;const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;const u

9、nsigned short NOT_FOUND_ERR = 8;const unsigned short NOT_SUPPORTED_ERR = 9;const unsigned short INUSE_ATTRIBUTE_ERR = 10;DOMImplementation 接口:由用户实现interface DOMImplementation boolean hasFeature(in DOMString feature, in DOMString version);DocumentFragment 接口:用于子树移动和插入interface DocumentFragment : Node

10、 ;Document 接口:interface Document : Node readonly attribute DocumentType doctype;readonly attribute DOMImplementation implementation;readonly attribute Element documentElement;Element createElement(in DOMString tagName)raises(DOMException);DocumentFragment createDocumentFragment();Text createTextNode

11、(in DOMString data);Comment createComment(in DOMString data);CDATASection createCDATASection(in DOMString data)raises(DOMException);ProcessingInstruction createProcessingInstruction(in DOMString target, in DOMString data)raises(DOMException);Attr createAttribute(in DOMString name)raises(DOMException

12、);EntityReference createEntityReference(in DOMString name)raises(DOMException);NodeList getElementsByTagName(in DOMString tagname);Node 接口interface Node / NodeTypeconst unsigned short ELEMENT_NODE = 1;const unsigned short ATTRIBUTE_NODE = 2;const unsigned short TEXT_NODE = 3;const unsigned short CDA

13、TA_SECTION_NODE = 4;const unsigned short ENTITY_REFERENCE_NODE = 5;const unsigned short ENTITY_NODE = 6;const unsigned short PROCESSING_INSTRUCTION_NODE = 7;const unsigned short COMMENT_NODE = 8;const unsigned short DOCUMENT_NODE = 9;const unsigned short DOCUMENT_TYPE_NODE = 10;const unsigned short

14、DOCUMENT_FRAGMENT_NODE = 11;const unsigned short NOTATION_NODE = 12;readonly attribute DOMString nodeName;readonly attribute DOMString nodeValue;readonly attribute unsigned short nodeType;readonly attribute Node parentNode;readonly attribute NodeList childNodes;readonly attribute Node firstChild;rea

15、donly attribute Node lastChild;readonly attribute Node previousSibling;readonly attribute Node nextSibling;readonly attribute NamedNodeMap attributes;readonly attribute Document ownerDocument;Node insertBefore(in Node newChild, in Node refChild)raises(DOMException);Node replaceChild(in Node newChild

16、, in Node oldChild)raises(DOMException);Node removeChild(in Node oldChild)raises(DOMException);Node appendChild(in Node newChild)raises(DOMException);boolean hasChildNodes();Node cloneNode(in boolean deep);NodeList 接口:interface NodeList Node item(in unsigned long index);readonly attribute unsigned l

17、ong length;NamedNodeMap 接口:interface NamedNodeMap Node getNamedItem(in DOMString name);Node setNamedItem(in Node arg)raises(DOMException);Node removeNamedItem(in DOMString name)raises(DOMException);Node item(in unsigned long index);readonly attribute unsigned long length;Attr 接口:interface Attr : Nod

18、e readonly attribute DOMString name;readonly attribute boolean specified;attribute DOMString value;Element 接口:interface Element : Node readonly attribute DOMString tagName;DOMString getAttribute(in DOMString name);void setAttribute(in DOMString name, in DOMString value)raises(DOMException);void remo

19、veAttribute(in DOMString name)raises(DOMException);Attr getAttributeNode(in DOMString name);Attr setAttributeNode(in Attr newAttr)raises(DOMException);Attr removeAttributeNode(in Attr oldAttr)raises(DOMException);NodeList getElementsByTagName(in DOMString name);void normalize();CharacterData 接口:inte

20、rface CharacterData : Node attribute DOMString data;readonly attribute unsigned long length;DOMString substringData(in unsigned long offset, in unsigned long count)raises(DOMException);void appendData(in DOMString arg)raises(DOMException);void insertData(in unsigned long offset, in DOMString arg)rai

21、ses(DOMException);void deleteData(in unsigned long offset, in unsigned long count)raises(DOMException);void replaceData(in unsigned long offset, in unsigned long count, in DOMString arg)raises(DOMException);Text 接口:interface Text : CharacterData Text splitText(in unsigned long offset)raises(DOMExcep

22、tion);Comment 接口:interface Comment : CharacterData ;扩展接口:CDATASection 接口:标记以定界的 CDATA 段interface CDATASection : Text ;DocumentType 接口:interface DocumentType : Node readonly attribute DOMString name;readonly attribute NamedNodeMap entities;readonly attribute NamedNodeMap notations;Node 接口:interface N

23、otation : Node readonly attribute DOMString publicId;readonly attribute DOMString systemId;Entity 接口:interface Entity : Node readonly attribute DOMString publicId;readonly attribute DOMString systemId;readonly attribute DOMString notationName;EntityReference 接口:interface EntityReference : Node ;Proc

24、essingInstruction 接口:interface ProcessingInstruction : Node readonly attribute DOMString target;attribute DOMString data;DOM2 包括核心规范和遍历与漫游规范。DOM3 包括核心规范和抽象机制与存取规范。DOM2 和 DOM3 的核心规范基本保持 DOM1 的接口结构,增加了命名空间( namespace)概念,并对少数接口的属性和方法做了增删和修改。module domvaluetype DOMString sequence;typedef unsigned long l

25、ong DOMTimeStamp;typedef Object DOMUserData;typedef Object DOMObject;interface DOMImplementation;interface DocumentType;interface Document;interface NodeList;interface NamedNodeMap;interface UserDataHandler;interface Element;interface DOMLocator;exception DOMException unsigned short code;/ Exception

26、Codeconst unsigned short INDEX_SIZE_ERR = 1;const unsigned short DOMSTRING_SIZE_ERR = 2;const unsigned short HIERARCHY_REQUEST_ERR = 3;const unsigned short WRONG_DOCUMENT_ERR = 4;const unsigned short INVALID_CHARACTER_ERR = 5;const unsigned short NO_DATA_ALLOWED_ERR = 6;const unsigned short NO_MODIF

27、ICATION_ALLOWED_ERR = 7;const unsigned short NOT_FOUND_ERR = 8;const unsigned short NOT_SUPPORTED_ERR = 9;const unsigned short INUSE_ATTRIBUTE_ERR = 10;/ Introduced in DOM Level 2:const unsigned short INVALID_STATE_ERR = 11;/ Introduced in DOM Level 2:const unsigned short SYNTAX_ERR = 12;/ Introduce

28、d in DOM Level 2:const unsigned short INVALID_MODIFICATION_ERR = 13;/ Introduced in DOM Level 2:const unsigned short NAMESPACE_ERR = 14;/ Introduced in DOM Level 2:const unsigned short INVALID_ACCESS_ERR = 15;/ Introduced in DOM Level 3:const unsigned short VALIDATION_ERR = 16;interface DOMImplement

29、ationSource DOMImplementation getDOMImplementation(in DOMString features);interface DOMImplementation boolean hasFeature(in DOMString feature, in DOMString version);/ Introduced in DOM Level 2:DocumentType createDocumentType(in DOMString qualifiedName, in DOMString publicId, in DOMString systemId)ra

30、ises(DOMException);/ Introduced in DOM Level 2:Document createDocument(in DOMString namespaceURI, in DOMString qualifiedName, in DocumentType doctype)raises(DOMException);/ Introduced in DOM Level 3:DOMImplementation getInterface(in DOMString feature);interface Node / NodeTypeconst unsigned short EL

31、EMENT_NODE = 1;const unsigned short ATTRIBUTE_NODE = 2;const unsigned short TEXT_NODE = 3;const unsigned short CDATA_SECTION_NODE = 4;const unsigned short ENTITY_REFERENCE_NODE = 5;const unsigned short ENTITY_NODE = 6;const unsigned short PROCESSING_INSTRUCTION_NODE = 7;const unsigned short COMMENT_

32、NODE = 8;const unsigned short DOCUMENT_NODE = 9;const unsigned short DOCUMENT_TYPE_NODE = 10;const unsigned short DOCUMENT_FRAGMENT_NODE = 11;const unsigned short NOTATION_NODE = 12;readonly attribute DOMString nodeName;attribute DOMString nodeValue;readonly attribute unsigned short nodeType;readonl

33、y attribute Node parentNode;readonly attribute NodeList childNodes;readonly attribute Node firstChild;readonly attribute Node lastChild;readonly attribute Node previousSibling;readonly attribute Node nextSibling;readonly attribute NamedNodeMap attributes;/ Modified in DOM Level 2:readonly attribute

34、Document ownerDocument;/ Modified in DOM Level 3:Node insertBefore(in Node newChild, in Node refChild)raises(DOMException);/ Modified in DOM Level 3:Node replaceChild(in Node newChild, in Node oldChild)raises(DOMException);/ Modified in DOM Level 3:Node removeChild(in Node oldChild)raises(DOMExcepti

35、on);Node appendChild(in Node newChild)raises(DOMException);boolean hasChildNodes();Node cloneNode(in boolean deep);/ Modified in DOM Level 2:void normalize();/ Introduced in DOM Level 2:boolean isSupported(in DOMString feature, in DOMString version);/ Introduced in DOM Level 2:readonly attribute DOM

36、String namespaceURI;/ Introduced in DOM Level 2:attribute DOMString prefix;/ Introduced in DOM Level 2:readonly attribute DOMString localName;/ Introduced in DOM Level 2:boolean hasAttributes();/ Introduced in DOM Level 3:readonly attribute DOMString baseURI;/ TreePositionconst unsigned short TREE_P

37、OSITION_PRECEDING = 0x01;const unsigned short TREE_POSITION_FOLLOWING = 0x02;const unsigned short TREE_POSITION_ANCESTOR = 0x04;const unsigned short TREE_POSITION_DESCENDANT = 0x08;const unsigned short TREE_POSITION_EQUIVALENT = 0x10;const unsigned short TREE_POSITION_SAME_NODE = 0x20;const unsigned

38、 short TREE_POSITION_DISCONNECTED = 0x00;/ Introduced in DOM Level 3:unsigned short compareTreePosition(in Node other);/ Introduced in DOM Level 3:attribute DOMString textContent;/ Introduced in DOM Level 3:boolean isSameNode(in Node other);/ Introduced in DOM Level 3:DOMString lookupNamespacePrefix(in DOMString namespaceURI, in boolean useDefault);/ Introduced in DOM Level 3:boolean isDefaultNamespace(in DOMString namespaceURI);/ Introduced in DOM Level 3:DOMString lookupNamespaceURI(in DOMString prefix);/ Introduced in DOM Level 3:boolean isEqualNode(in Node arg);

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。