- 浏览: 84877 次
最近访客 更多访客>>
最新评论
-
ww20042005:
这两步就完成了数据库初始化,也太简单了吧!
mysql初始化数据库 -
biaoming:
我也是debian 64的,也想安装qmail,有什么问题希望 ...
在Debian 64bit Sarge版本上安装QMAIL的痛苦之行
When to Use DOM
On the other hand, if you are dealing with simple data structures and if XML Schema isn't a big part of your plans, then you may find that one of the more object-oriented standards, such as JDOM and dom4j, is better suited for your purpose.Because it was designed for use with languages such as C and Perl, DOM does not take advantage of Java's object-oriented features.
看到这里,也许DOM和我想象的那种不同,到底DOM是怎么设计为C,Perl适用的语言的呢?JDom可能就是我以前接触的那个。在看完了全部内容后,我有了大概的概念。JDom之类专门用来处理比较简单的文档,也就是在element之间的内容不是复杂的文档,或者从dom的角度来讲,element中间夹的只是一个text node。而dom就不相同了,他可以处理很复杂的文档,而且dom的健壮性和执行效率都要远远高于jdom。引用原文的一些内容,详细的讲解了如何去选择dom还是jdom。
As you can see, when you are using DOM, even a simple operation such as getting the text from a node can take a bit of programming. So if your programs handle simple data structures, then JDOM, dom4j, or even the 1.4 regular-expression package (java.util.regex
) may be more appropriate for your needs.
For full-fledged documents and complex applications, on the other hand, DOM gives you a lot of flexibility. And if you need to use XML Schema, then again DOM is the way to go--for now, at least.
If you process both documents and data in the applications you develop, then DOM may still be your best choice. After all, after you have written the code to examine and process a DOM structure, it is fairly easy to customize it for a specific purpose. So choosing to do everything in DOM means that you'll only have to deal with one set of APIs, rather than two.
In addition, the DOM standard is a codified standard for an in-memory document model. It's powerful and robust, and it has many implementations. That is a significant decision-making factor for many large installations, particularly for large-scale applications that need to minimize costs resulting from API changes.
Finally, even though the text in an address book may not permit bold, italics, colors, and font sizes today, someday you may want to handle these things. Because DOM will handle virtually anything you throw at it, choosing DOM makes it easier to future proof your application.
发表评论
-
XML的学习笔记(一)
2007-04-02 12:23 993记得在大学的时候,花了几天的时间看看了XML,可现在再拾起来的 ... -
学习问题[XML学习]
2007-04-02 14:04 8711、一个XML文档可以含有多个dtd文档吗? 答:当然可以完全 ... -
XML的学习笔记(二)
2007-04-02 14:07 730reference to some binary data ... -
Java API for XML Processing
2007-04-05 01:44 1080The Java API for XML Processing ... -
Simple API for XML
2007-04-09 13:27 1057SAX是Simple API for XML的简称。 什么是S ... -
Echoing an XML File with the SAX Parser
2007-04-15 08:34 1008首先要继承ContentHandler类,然后复写几个函数。 ... -
SAX的异常处理。
2007-04-20 14:12 852SAXParseException SAXException ... -
Using the Validating Parser
2007-04-23 14:12 1032首先要明白,Validating Parser是用什么来验证 ... -
Handling Lexical Events
2007-04-25 01:08 784How the LexicalHandler Works ... -
DTDHandler And EntityResolver
2007-04-25 13:43 1084The DTDHandler API In Choosing ... -
Portal的简单介绍
2007-05-18 03:35 1508什么是Portal? A server to ag ... -
Portal的架构
2007-05-18 07:16 1902Portal的起源 WebSphere Portal find ... -
了解Portlet
2007-05-21 02:38 1050The base building blocks of a P ... -
Portlet的API编程
2007-05-28 09:43 1102Abstract portlet与concrete portl ... -
Portlet Life Circle
2007-05-29 14:51 1261Portlet life circle diagram in ... -
Porlet的类和接口
2007-06-05 09:41 1756Portlet->PortletAdapter Port ... -
servlet-api的基本类和其接口的介绍
2007-07-16 15:37 1611基本类和接口 一、javax.servlet.Servle ...
相关推荐
《DOM Scripting: Web Design with JavaScript and the Document Object Model》是由Jeremy Keith撰写的一本关于JavaScript和DOM编程的经典著作。这本书深入浅出地介绍了如何利用JavaScript动态操控网页内容,提升...
本书名为《Web Design with JavaScript and the Document Object Model 2005》(2005年版的Web设计与JavaScript及文档对象模型),是由英国知名网络编程专家Jeremy Keith所著。此书主要讲述了如何在Web开发中运用...
《DOM Scripting: Web Design with JavaScript and the Document Object Model》第二版是一本由Jeremy Keith编写,Jeffrey Sambells合作完成的经典JavaScript教程。本书深入浅出地介绍了如何使用JavaScript与文档...
文档对象模型(Document Object Model,简称DOM)是一个跨平台的接口,它允许程序和脚本动态地访问和更新文档的内容、结构和样式。DOM以树状结构的形式表示HTML或XML文档,它将文档视为一个节点树,每个节点代表文档...
文档对象模型(DOM,Document Object Model)是针对HTML和XML文档的一种应用编程接口(API),它以树状结构的形式表示整个文档,为程序员提供了动态地访问和修改文档内容、结构和样式的手段。当浏览器加载页面时,它...
本文概述DOM分类,document的方法以及属性、element的方法和属性document获取全局内容和创建全局内容,其中包括了节点属性和节点的相关方法和分类,本文结尾拓展了操作节点的方法和删除空文本节点的相关方法
Delphi Document Object Model(DOM)是一个开源项目,它允许开发者在Delphi编程环境中利用DOM(文档对象模型)处理XML文档。DOM是一种W3C标准,它提供了一种结构化的表示XML文档的方式,允许程序员和脚本语言以统一...
This book deals with a programming language, but it isn’t intended for programmers. This is a book for web designers. Specifically, this book is intended for standards-aware designers who are ...
标题“DOM.Scripting.Web.Design.with.JavaScript.and.the.Document.Object.Model”直接指出了本书的主要内容和技术领域,即利用JavaScript和文档对象模型(Document Object Model,简称DOM)进行网页设计的技术方法...
文档对象模型(Document Object Model,简称DOM)是一种用于表示和修改HTML、XML等结构化文档的标准编程接口。它为文档中的元素提供了树状结构,使得开发者能够通过编程语言(如JavaScript)来访问、添加、删除或...
Msxml2.DOMDocument是Microsoft XML库(MSXML)中的核心组件,它实现了W3C的Document Object Model (DOM)接口。DOM是一种编程接口,允许程序和脚本动态地访问和更新XML文档的结构、内容和样式。DOMDocument对象提供...
Preface Acknowledgements 1 XML for Data 2 XML Protocols ...Document Object Model 10 Creating New XML Documents with DOM 11 The Document Object Model Core 12 The DOM Traversal ...
org.dom4j.tree Contains the default implementations of the dom4j Document Object Model together with some helpful base classes for those wishing to implement their own document object model. ...