- 浏览: 70976 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
george.gu:
lqjacklee 写道怎么解决。。 First: Conf ...
Bad version number in .class file -
lqjacklee:
怎么解决。。
Bad version number in .class file -
flyqantas:
would you pleade left more mate ...
UML Extension
There are many kinds of XML Parsers in Java:
- DOM (JDK embedded DOM implementation)
- SAX
- JDOM (It is an alternative to DOM and SAX)
- Digester (Jakarta commons Digester)
- JAXB(OXM, JDK1.6 embedded JAXB2.0 implementation)
- dom4j
- Xerces
- KXML
- ...
- What's the difference between DOM Node and DOM Element?
Node Types
- The Node object represents a single node in document tree.
- There are many types of Node used to represent dedicated architecture of XML document.
NodeType |
Description |
Children Nodes |
Element |
Represents an element |
Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReference |
Attr |
Represents an attribute |
Text, EntityReference |
Text |
Represents textual content in an element or attribute |
None |
CDATASection |
Represents a CDATA section in a document (text that will NOT be parsed by a parser) |
None |
Document |
Represents the entire document (the root-node of the DOM tree) |
Element (max. one), ProcessingInstruction, Comment, DocumentType |
NodeType |
Named Constant |
NodeType Constant |
getNodeName() return |
getNodeValue() return |
Element |
ELEMENT_NODE |
1 |
Element name/ tagName |
Null |
Attr |
ATTRIBUTE_NODE |
2 |
Attribute name |
Attribute value |
Text |
TEXT_NODE |
3 |
#text |
content of node |
CDATASection |
CDATA_SECTION_NODE |
4 |
#cdata-section |
content of node |
Document |
DOCUMENT_NODE |
9 |
#document |
null |
- Element is a kind of Node or It is sub-class of Node interface in Java point of view.
- If a Node has NodeType ==1, we can say it is a Element.
- Element.getTagName equals to Element.getNodeName().
JDK embedded DOM Parser
Useful interfaces for DOM parser
Here only list the key methods and that used often, for other methos please refer to javadoc.
Node.getNodeType(): short
Node.getChildNodes(): NodeList
Node.getAttributes(): NamedNodeMap
Node.getNodeName():String
Node.getNodeValue():String
Node.getTextContent(): String
Element.getElementsByTagName(String name):NodeList
Introspect XML with DOM defined methods
Locate Node with XPath
Adventage and Disadventage:
发表评论
-
javax.naming.CommunicationException: remote side declared peer gone on this JVM.
2012-07-11 09:44 2329javax.naming.ServiceUnavailable ... -
Generate special format numbers
2012-04-27 00:06 867DecimalFormat df = new DecimalF ... -
Singleton Service in Weblogic Cluster
2012-03-21 00:12 653http://blog.csdn.net/mobicents/ ... -
Scheduled ThreadPool Executor suppressed or stopped after error happen
2012-03-20 16:54 1004ScheduledThreadPoolExecutor ... -
Bad version number in .class file
2012-01-27 00:35 845Bad version number in .class fi ... -
User Data Header in SMPP SUBMIT_SM
2012-01-25 22:30 2298SMPP optional Parameters for ... -
jQuery study
2011-12-28 00:44 0to be study -
Java is Pass-by-Value or Pass-by-Reference?
2011-12-19 19:18 653What's saved in Object Referenc ... -
java.util.Properties: a subclass of java.util.Hashtable
2011-12-13 06:57 735I met a problem this afternoon ... -
Jmock usage
2011-12-02 05:37 0Discuss how Jmock working. -
Oracle Index Usage
2011-12-15 05:26 570Like a hash mapping for record' ... -
AOP(2):AOP与动态代理JDK Proxy and Cglib Proxy
2011-05-12 16:20 967使用动态代理(JDK Proxy 或者Cglib Proxy) ... -
AOP(1):应用中的几个小故事
2011-05-09 21:49 937I had heared about AOP almost 7 ... -
异步系统设计:push vs pull
2011-05-02 23:59 1109今天讨论问题时,有个同事说系统A是主动去系统B里“拿”消息,我 ... -
Velocity Usage
2011-04-28 22:52 963You can find velocity mannua ... -
Java Regular Expression (Java正则表达式)
2011-04-23 06:58 892In current Project, we need to ... -
File upload and download in Java Web Application.
2011-04-21 21:08 1671最近在项目中遇到一个下载文件的老问题。之所以说是老问题,因为在 ... -
Manage zip content using Java APIs
2011-04-21 18:14 985JDK provide a set of utils to c ... -
Beanshell: how and where to use beanshell
2011-04-21 00:33 2050How to use beanshell beansh ... -
OXM: JAXB2.0 in JDK1.6
2011-04-20 22:53 12041.1.1 JAXB 2.0: ObjectàXML ...
相关推荐
3.2.4 用dom解析xml文档实例 53 3.3 使用sax解析xml文档 65 3.3.1 sax的处理机制 66 3.3.2 配置sax解析器 69 3.3.3 sax解析器工厂 70 3.3.4 sax的异常类 71 3.3.5 errorhandler接口 73 3.3.6 使用sax解析xml...
3.2.4 用dom解析xml文档实例 53 3.3 使用sax解析xml文档 65 3.3.1 sax的处理机制 66 3.3.2 配置sax解析器 69 3.3.3 sax解析器工厂 70 3.3.4 sax的异常类 71 3.3.5 errorhandler接口 73 3.3.6 使用sax解析xml...
3.2.4 用dom解析xml文档实例 53 3.3 使用sax解析xml文档 65 3.3.1 sax的处理机制 66 3.3.2 配置sax解析器 69 3.3.3 sax解析器工厂 70 3.3.4 sax的异常类 71 3.3.5 errorhandler接口 73 3.3.6 使用sax解析xml...
3.2.4 用dom解析xml文档实例 53 3.3 使用sax解析xml文档 65 3.3.1 sax的处理机制 66 3.3.2 配置sax解析器 69 3.3.3 sax解析器工厂 70 3.3.4 sax的异常类 71 3.3.5 errorhandler接口 73 3.3.6 使用sax解析xml...
Sparta 是一个轻量级的 Java XML 包,它包括一个 XML 解析器、一个 DOM 和一个 XPath 解释器。 代码量小,解析器速度快,对象内存小,DOM API 干净简单。
pugixml是一个C ++ XML处理库,它由具有丰富的遍历/修改功能的类DOM接口,非常快的XML解析器(从XML文件/缓冲区构造DOM树)以及用于复杂数据驱动的XPath 1.0实现组成。树查询。 还提供了完全的Unicode支持,具有...
XML DOM with XPath and namespace support sequential XML DOM parser XML SAX parser with class handlers for specific objects XML serializer (with and without enhanced RTTI) direct XML reader/writer ...
------------------------------------XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator------------------------------------Copyright (c) 2012 Sergey IlinskyDual licensed under ...
为了方便网友编程,将资源共享一下 dom4j 2.0.0-ALPHA-2 API Packages org.dom4j Defines the XML ...org.dom4j.xpp Provides implementation classes to cleanly integrate dom4j with the XML Pull Parser XPP
JsoupXpath 是一款纯Java开发的使用xpath解析提取html数据的解析器,针对html解析完整实现了W3C XPATH 1.0标准语法,xpath的Lexer和Parser基于Antlr4构建,html的DOM树生成采用Jsoup,故命名为JsoupXpath....
XML的parser发展为两类:一种是"非确认类paeser",只检测文档是否遵守XML语法规则,是否用元素标识建立了文档树。另一种是"确认类paeser",它不但检测文档语法,结构树,而且比较解析你使用的元素标识是否遵守了相应...
.Provides XML programming using the firehose and DOM parser models, XSLT,XPATH, and schemas .Focuses on ASP.NET wed Form Designer, walking through the page life-cycle and cacheing, and ...
This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library ...
JavaTM 2 Platform Standard Edition 6 API 规范 本文档是 Java 2 Platform Standard Edition 6.0 的 API 规范。 请参见: 描述 ...javax.xml.xpath 此包提供了用于 XPath 表达式的计算和访问计算...
它是一个敏捷HTML解析器,可构建读/写DOM并支持纯XPATH或XSLT(无需了解XPATH或XSLT即可使用它,不用担心...)。 这是一个.NET代码库,可让您解析“网络外” HTML文件。 解析器非常容忍格式错误的“真实世界” HTML...
javax.xml.xpath org.ietf.jgss org.omg.CORBA org.omg.CORBA_2_3 org.omg.CORBA_2_3.portable org.omg.CORBA.DynAnyPackage org.omg.CORBA.ORBPackage org.omg.CORBA.portable org.omg.CORBA....
javax.xml.xpath org.ietf.jgss org.omg.CORBA org.omg.CORBA_2_3 org.omg.CORBA_2_3.portable org.omg.CORBA.DynAnyPackage org.omg.CORBA.ORBPackage org.omg.CORBA.portable org.omg.CORBA....
• Provides XML programming using the firehose and DOM parser models, XSLT, XPATH, and schemas • Focuses on ASP.NET Web Form Designer, walking through the page life-cycle and caching, and ...
javax.xml.xpath 此包提供了用于 XPath 表达式的计算和访问计算环境的 object-model neutral API。 org.ietf.jgss 此包提供一个框架,该框架允许应用程序开发人员通过利用统一的 API 使用一些来自各种基础安全机制...
javax.xml.xpath 此包提供了用于 XPath 表达式的计算和访问计算环境的 object-model neutral API。 org.ietf.jgss 此包提供一个框架,该框架允许应用程序开发人员通过利用统一的 API 使用一些来自各种基础安全机制...