Java里处理XML的开源工具

使用Java编程,最重要的一项特性就是要对open source projects比较熟悉,而且能够灵活应用。

 

下面列出了一些与XML处理有关的开源工具:

Term

Full Name

References

Description

JAXP

Java API for XML Processing

DOM, SAX, StAX, JDOM, dom4j, XOM

Java API for XML Processing (JAXP) 允许使用几种不同的 API 来验证、解析和转换 XMLJAXP 既提供了使用方便性,又提供了开发商中立性。

 

从一开始,Java API for XML Processing (JAXP) 就提供了两种方法来处理 XML:文档对象模型(DOM)方法是用标准的对象模型表示 XML 文档;Simple API for XML (SAX) 方法使用应用程序提供的事件处理程序来处理 XMLJSR-173 提出了一种面向流的新方法:Streaming API for XML (StAX)。其最终版本于 2004 3 月发布,并成为了 JAXP 1.4(将包含在即将发布的 Java 6 中)的一部分。

StAX

Streaming API for XML

 

Streaming API for XML (StAX) 是用 Java™ 语言处理 XML 的最新标准。作为一种面向流的方法,无论从性能还是可用性上都优于其他方法,如 DOM SAX

JAXB

Java Architecture for XML Binding

Castor, XMLBeans, JiBX, XStream

XML and Java technology are recognized as ideal building blocks for developing Web services and applications that access Web services. A new Java API called Java Architecture for XML Binding (JAXB) can make it easier to access XML documents from applications written in the Java programming language.

JAXB allows Java developers to access and process XML data without having to know XML or XML processing. For example, there's no need to create or use a SAX parser or write callback methods.

SAAJ

SOAP with Attachments API for Java

 

SOAP with Attachments API for Java (SAAJ)—— Java API for XML Messaging (JAXM)的一个分支——能够使许多必需的步骤变得自动化,例如创建连接,或者创建和发送实际消息

 

---JAXP

JDOM:http://www.jdom.org/

We want to provide a solution for using XML from Java that is as simple as Java itself.

There is no compelling reason for a Java API to manipulate XML to be complex, tricky, unintuitive, or a pain in the neck. JDOMTM is both Java-centric and Java-optimized. It behaves like Java, it uses Java collections, it is completely natural API for current Java developers, and it provides a low-cost entry point for using XML.

While JDOM interoperates well with existing standards such as the Simple API for XML (SAX) and the Document Object Model (DOM), it is not an abstraction layer or enhancement to those APIs. Rather, it provides a robust, light-weight means of reading and writing XML data without the complex and memory-consumptive options that current API offerings provide.

 

dom4j:https://sourceforge.net/projects/dom4j/

dom4j is a simple and flexible open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework with full integration with DOM, SAX and JAXP.

 

XOM: http://www.xom.nu/

XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with Java that strives for correctness, simplicity, and performance, in that order.

 

Woodstox: http://woodstox.codehaus.org/

Woodstox is a high-performance validating namespace-aware StAX-compliant (JSR-173) Open Source XML-processor written in Java.

XML processor means that it handles both input (== parsing) and output (== writing, serialization)), as well as supporting tasks such as validation.

 

--Schema

XMLSchema: http://ws.apache.org/commons/XmlSchema/

XMLSchema is a lightweight Java object model that can be used to manipulate and generate XML schema representations. You can use it to read XML Schema (xsd) files into memory and analyze or modify them, or to create entirely new schemata from scratch.

 

--JAXB

Castor: http://www.castor.org/

Castor is an Open Source data binding framework for Java[tm]. It's the shortest path between Java objects, XML documents and relational tables. Castor provides Java-to-XML binding, Java-to-SQL persistence, and more.

 

JiBX: http://jibx.sourceforge.net/

JiBX is a tool for binding XML data to Java objects. It's extremely flexible, allowing you to start from existing Java code and generate an XML schema, start from an XML schema and generate Java code, or bridge your existing code to a schema that represents the same data. It also provides very high performance, outperforming all other Java data binding tools across a wide variety of tests.

 

XMLBeans: http://xmlbeans.apache.org/

XMLBeans is a technology for accessing XML by binding it to Java types. XMLBeans provides several ways to get at the XML, including:

  • Through XML schema that has been compiled to generate Java types that represent schema types. In this way, you can access instances of the schema through JavaBeans-style accessors after the fashion of "getFoo" and "setFoo".

    The XMLBeans API also allows you to reflect into the XML schema itself through an XML Schema Object model.

  • A cursor model through which you can traverse the full XML infoset.
  • Support for XML DOM.

XStream: http://xstream.codehaus.org/

XStream is a simple library to serialize objects to XML and back again. 最早好像是由thoughtworks公司开始推出的,我们项目中一直使用这个。

 

--XSLT

xalan: http://xml.apache.org/xalan-j/

Xalan is an XSLT (Extensible Stylesheet Language Transformation) processor for transforming XML documents into HTML, text, or other XML document types.

 

 

 

你可能感兴趣的:(java,xml,schema,api,processing,binding)