The grunt work is handled by dom4j.
这些工作都是由dom4j处理的。
Listing 7. dom4j modify method.
清单7 .dom 4 jmodify方法。
Listing 6. dom4j top-level code.
清单6 . dom 4 j的顶级代码。
Listing 6. dom4j processing the XML data.
清单6 . dom 4 j处理XML数据。
For these tests, I used dom4j version 1.3.
对于这些测试,我使用了dom 4 j V1.3。
The dom4j tool requires little effort, as you'll now see.
您将看到,dom4j工具仅需要很少的工作即可完成解析。
Here, you see one of the features of dom4j: in-memory processing.
这里向您展示了dom 4 j的一个功能:在内存中进行处理。
The dom4j modify method in Listing 7 is very similar to that used with JDOM.
清单7中dom 4 j modify方法与JDOM中使用的方法非常类似。
The dom4j document object model is fast, memory-efficient, and also offers great extensibility.
dom4j文档对象模型不仅速度快、内存使用高效,并且提供了很好的可扩展性。
But, you might want to work with JDOM constructs, or perhaps the object model that dom4j provides.
但是,有可能希望使用JDOM结构或者dom 4 j提供的对象模型。
Some are wildly comprehensive, such as Dom4J, and others simply strive to solve one small problem well.
一些相当地全面,如Dom4J,而另一些则仅着力于解决好一个小问题。
Based on the present implementations I'd recommend dom4j rather than JDOM for anyone starting a new project.
基于当前实现,我愿为着手新项目的人们推荐dom 4 j,而不是JDOM。
Like dom and dom4j, AXIOM defines the API used to access and manipulate the tree representation using interfaces.
与dom和dom 4 j一样,AXIOM使用接口定义了用于访问和操作树表示的API。
The top-level code for dom4j is a little more involved than that for JDOM, but it works along very similar lines.
dom 4 j的顶级代码比JDOM的稍微复杂些,但是它们的代码行非常类似。
Compared to the best performers in this area, dom4j takes more than 10 times the memory to represent the same data.
与该领域中最优秀的执行者相比,表示相同的数据,dom 4 j所占用的内存是前者的10倍。
One potential use is to allow portions of a document to be mapped to and from a document model (such as DOM, JDOM, or dom4j).
一种可能的用法就是允许在部分文档和文档模型(例如DOM、JDOM或dom4j)之间相互映射。
Clients then use some scheme to transfer these files into local storage, and you can use dom4j to parse and modify the file data.
客户机随后使用某种模式将这些文件传递到本地存储中,然后您可以使用dom 4j解析并修改文件数据。
By using different factories for the dom4j document build you can get documents constructed from different families of components.
通过使用不同工厂进行dom 4 j文档构建,您能获取不同系列的组件中构造的文档。
Dom4j is able to construct its in-memory representation of the documents in less than twice the amount of time taken by the parser alone.
dom 4 j构造文档的内存表示所花费的时间不到单独使用解析器所花费时间的两倍。
In addition to SAX and dom, and JAXP, you can use JDOM, XOM, dom4j, StAX, and several other variations to work with XML (fairly) directly.
除了SAX、dom和JAXP之外,我们还可以使用JDOM、XOM、dom 4 j、StAX和一些其它的变体非常直接地操作XML。
Dom4j offers better performance than any of the data binding approaches in this area, beating JiBX by a smidgen and Zeus by not much more.
在该领域中,dom 4 j提供的性能是所有数据绑定方法中最好的,比JiBX稍好一点,比Zeus更加好一点。
As you can see in Listing 6, dom4j USES a factory approach for constructing objects included in the document representation built from a parse.
正如您在清单6中看到的,dom 4 j使用一个工厂方法来构造文档表示(从语法分析构建)中包含的对象。
Among the three leading contenders in the ease of use category, dom4j differs from the others in using an interface-based approach with multiple layers of inheritance.
就使用方便这一范畴而言,在JDOM、dom4j和electric XML这三个主要竞争者中,dom 4 j与其它两个的区别在于它使用带有多个继承层的基于接口的方法。
When I began looking at the available data binding frameworks I was surprised to see that they didn't perform all that well compared with document models such as dom4j.
当我开始研究可用的数据绑定框架时,我惊奇地看到:与文档模型(如 dom4j)相比,它们并不是执行得都那样好。
This is partially due to its internal use of a document model, but the amount of memory used by JBind is several times larger than that needed by a document model (such as dom4j) alone.
这有一部分是由于它在内部使用了文档模型,但是JBind使用的内存量要比单独使用文档模型(如dom 4 j)所需的内存量大好几倍。
The main differences here are that I save the DocumentFactory used to build the dom4j document representation (line 5) and flush the writer after outputting the modified document text (line 10).
这里的主要区别是我保存了用来构建dom4j文档表示的DocumentFactory (第 5 行),并在输出已修改的文档文本之后刷新了writer(第 10 行)。
I have seen many requests for a comparison of SAX, dom, JDOM, and dom4j to JAXP, but making such comparisons is impossible because the first four APIs serve a completely different purpose from JAXP.
我曾经看到过许多关于将SAX、dom、JDOM和dom 4 j与JAXP进行比较的请求,但作这样的比较是不可能的,因为前面四个API与JAXP具有完全不同的用途。
There's not nearly as much variation here as in the input tests, though the fact that dom4j does better than any of the data binding frameworks suggests that they all still have room for improvement.
尽管这里的结果与输入测试的几乎没有太大的变化,但是dom4j 的确优于其它任何数据绑定框架的这一事实表明它们仍然有改进的余地。
There's not nearly as much variation here as in the input tests, though the fact that dom4j does better than any of the data binding frameworks suggests that they all still have room for improvement.
尽管这里的结果与输入测试的几乎没有太大的变化,但是dom4j 的确优于其它任何数据绑定框架的这一事实表明它们仍然有改进的余地。
应用推荐