`
pwosboy
  • 浏览: 84196 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

Document Object Model

阅读更多

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.

 
 
评论

相关推荐

    DOM Scripting.Web.Design.with.JavaScript.and.the.Document.Object.Model(JavaScript DOM编程艺术)

    《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

    本书名为《Web Design with JavaScript and the Document Object Model 2005》(2005年版的Web设计与JavaScript及文档对象模型),是由英国知名网络编程专家Jeremy Keith所著。此书主要讲述了如何在Web开发中运用...

    DOM Scripting Web Design JavaScript and the Document Object Model (2nd)

    《DOM Scripting: Web Design with JavaScript and the Document Object Model》第二版是一本由Jeremy Keith编写,Jeffrey Sambells合作完成的经典JavaScript教程。本书深入浅出地介绍了如何使用JavaScript与文档...

    Web Design with JavaScript and the Document Object Model (2nd Edition)

    文档对象模型(Document Object Model,简称DOM)是一个跨平台的接口,它允许程序和脚本动态地访问和更新文档的内容、结构和样式。DOM以树状结构的形式表示HTML或XML文档,它将文档视为一个节点树,每个节点代表文档...

    什么是DOM(Document Object Model)文档对象模型

    文档对象模型(DOM,Document Object Model)是针对HTML和XML文档的一种应用编程接口(API),它以树状结构的形式表示整个文档,为程序员提供了动态地访问和修改文档内容、结构和样式的手段。当浏览器加载页面时,它...

    DOM(document object model)文档对象模型

    本文概述DOM分类,document的方法以及属性、element的方法和属性document获取全局内容和创建全局内容,其中包括了节点属性和节点的相关方法和分类,本文结尾拓展了操作节点的方法和删除空文本节点的相关方法

    Delphi Document Object Model-开源

    Delphi Document Object Model(DOM)是一个开源项目,它允许开发者在Delphi编程环境中利用DOM(文档对象模型)处理XML文档。DOM是一种W3C标准,它提供了一种结构化的表示XML文档的方式,允许程序员和脚本语言以统一...

    Web.Design.with.JavaScript.and.the.Document.Object.Model.2005.pdf

    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

    标题“DOM.Scripting.Web.Design.with.JavaScript.and.the.Document.Object.Model”直接指出了本书的主要内容和技术领域,即利用JavaScript和文档对象模型(Document Object Model,简称DOM)进行网页设计的技术方法...

    .the.document.object.model

    文档对象模型(Document Object Model,简称DOM)是一种用于表示和修改HTML、XML等结构化文档的标准编程接口。它为文档中的元素提供了树状结构,使得开发者能够通过编程语言(如JavaScript)来访问、添加、删除或...

    ActiveObject 对象 Msxml2.DOMDocument 详解

    Msxml2.DOMDocument是Microsoft XML库(MSXML)中的核心组件,它实现了W3C的Document Object Model (DOM)接口。DOM是一种编程接口,允许程序和脚本动态地访问和更新XML文档的结构、内容和样式。DOMDocument对象提供...

    processing xml with java

    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 ...

    dom4j api 参考手册

    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. ...

Global site tag (gtag.js) - Google Analytics