J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.

Slides:



Advertisements
Similar presentations
1 eXtensible Markup Language. XML is based on SGML: Standard Generalized Markup Language HTML and XML are both based on SGML 2 SGML HTMLXML.
Advertisements

J0 1 Marco Ronchetti - Web architectures – Laurea Specialistica in Informatica – Università di Trento Java XML parsing.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialitica in Informatica – Università di Trento.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialitica in Informatica – Università di Trento.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialitica in Informatica – Università di Trento.
1 Roger L. Costello 16 June 2010 XQuery
Final and Abstract Classes
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
The Java Platform and XML Portable Code, Portable Data James Duncan Davidson Staff Engineer, Sun Microsystems, Inc.
11 Copyright © 2005, Oracle. All rights reserved. Using Arrays and Collections.
The Document Object Model
Technische universität dortmund Service Computing Service Computing Prof. Dr. Ramin Yahyapour IT & Medien Centrum 22. Oktober 2009.
XML INTRODUCTION Prepared by Hongming Yu Modified by Fernando Farfán.
SE 5145 – eXtensible Markup Language (XML ) DOM (Document Object Model) (Part II – Java API) /Spring, Bahçeşehir University, Istanbul.
SDPL 2002Notes 3: XML Processor Interfaces1 3.3 JAXP: Java API for XML Processing n How can applications use XML processors? –A Java-based answer: through.
SDPL 2003Notes 3: XML Processor Interfaces1 3.3 JAXP: Java API for XML Processing n How can applications use XML processors? –A Java-based answer: through.
SAX A parser for XML Documents. XML Parsers What is an XML parser? –Software that reads and parses XML –Passes data to the invoking application –The application.
14-Jun-15 DOM. SAX and DOM SAX and DOM are standards for XML parsers-- program APIs to read and interpret XML files DOM is a W3C standard SAX is an ad-hoc.
Parsing XML into programming languages JAXP, DOM, SAX, JDOM/DOM4J, Xerces, Xalan, JAXB.
21-Jun-15 SAX (Abbreviated). 2 XML Parsers SAX and DOM are standards for XML parsers-- program APIs to read and interpret XML files DOM is a W3C standard.
1 Processing XML with Java Representation and Management of Data on the Internet A comprehensive tutorial about XML processing with JavaXML processing.
1 Processing XML with Java CS , Spring 2008/9.
MC365 XML Parsers. Today We Will Cover: An overview of the Java API’s used for XML processing Creating an XML document in Java Parsing an XML document.
JAX- Java APIs for XML by J. Pearce. Some XML Standards Basic –SAX (sequential access parser) –DOM (random access parser) –XSL (XSLT, XPATH) –DTD Schema.
Apache DOM Parser©zwzOctober 24, 2002 Wenzhong Zhao Department of Computer Science The University of Kentucky.
Processing of structured documents Spring 2003, Part 5 Helena Ahonen-Myka.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools Leonidas Fegaras.
17 Apr 2002 XML Programming: JAXP Andy Clark. Java API for XML Processing Standard Java API for loading, creating, accessing, and transforming XML documents.
1 XML Data Management 4. Domain Object Model Werner Nutt.
SDPL 2004Notes 3: XML Processor Interfaces1 3.3 JAXP: Java API for XML Processing n How can applications use XML processors? –A Java-based answer: through.
17 Apr 2002 XML Programming - DOM Andy Clark. DOM Design Premise Derived from browser document model Defined in IDL – Lowest common denominator programming.
Advanced Java Session 9 New York University School of Continuing and Professional Studies.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
3/29/2001 O'Reilly Java Java API for XML Processing 1.1 What’s New Edwin Goei Engineer, Sun Microsystems.
SAX. What is SAX SAX 1.0 was released on May 11, SAX is a common, event-based API for parsing XML documents Primarily a Java API but there implementations.
Beginning XML 4th Edition. Chapter 12: Simple API for XML (SAX)
The XML Document Object Model (DOM) Aug’10 – Dec ’10.
XML Processing in Java. Required tools Sun JDK 1.4, e.g.: JAXP (part of Java Web Services Developer Pack, already in Sun.
Java API for XML Processing (JAXP) Dr. Rebhi S. Baraka Advanced Topics in Information Technology (SICT 4310) Department of Computer.
Sheet 1XML Technology in E-Commerce 2001Lecture 3 XML Technology in E-Commerce Lecture 3 DOM and SAX.
Consuming eXtensible Markup Language (XML) feeds.
Consuming eXtensible Markup Language (XML) feeds.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
Document Object Model DOM. Agenda l Introduction to DOM l Java API for XML Parsing (JAXP) l Installation and setup l Steps for DOM parsing l Example –Representing.
Java and XML. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information about a document. Tags are added.
Apache DOM Parser©zwzOctober 24, 2002 Wenzhong Zhao Department of Computer Science The University of Kentucky.
XML and SAX (A quick overview) ● What is XML? ● What are SAX and DOM? ● Using SAX.
When we create.rtf document apart from saving the actual info the tool saves additional info like start of a paragraph, bold, size of the font.. Etc. This.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
7-Mar-16 Simple API XML.  SAX and DOM are standards for XML parsers-- program APIs to read and interpret XML files  DOM is a W3C standard  SAX is an.
13-Mar-16 DOM. 2 Difference between SAX and DOM DOM reads the entire XML document into memory and stores it as a tree data structure SAX reads the XML.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
USING ANDROID WITH THE DOM. Slide 2 Lecture Summary DOM concepts SAX vs DOM parsers Parsing HTTP results The Android DOM implementation.
1 Introduction SAX. Objectives 2  Simple API for XML  Parsing an XML Document  Parsing Contents  Parsing Attributes  Processing Instructions  Skipped.
21-Jun-16 Document Object Model DOM. SAX and DOM SAX and DOM are standards for XML parsers-- program APIs to read and interpret XML files DOM is a W3C.
Java API for XML Processing
{ XML Technologies } BY: DR. M’HAMED MATAOUI
In this session, you will learn to:
Unit 4 Representing Web Data: XML
Parsing XML into programming languages
Java/XML.
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Chapter 7 Representing Web Data: XML
Java API for XML Processing
DOM 8-Dec-18.
DOM 24-Feb-19.
Presentation transcript:

J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Java XML parsing

J0 2 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Tree-based API A tree-based API compiles an XML document into an internal tree structure. This makes it possible for an application program to navigate the tree to achieve its objective. The Document Object Model (DOM) working group at the W3C is developing a standard tree-based API for XML. Event-based API An event-based API reports parsing events (such as the start and end of elements) to the application using callbacks. The application implements and registers event handlers for the different events. Code in the event handlers is designed to achieve the objective of the application. The process is similar (but not identical) to creating and registering event listeners in the Java Delegation Event Model. Tree-based vs Event-based API

J0 3 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento SAX is a set of interface definitions For the most part, SAX is a set of interface definitions. They specify one of the ways that application programs can interact with XML documents. (There are other ways for programs to interact with XML documents as well. Prominent among them is the Document Object Model, or DOM) SAX is a standard interface for event-based XML parsing, developed collaboratively by the members of the XML-DEV mailing list. SAX 1.0 was released on Monday 11 May 1998, and is free for both commercial and noncommercial use. The current version is SAX (released on 29-January 2002) See what is SAX?

J0 4 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento JAXP: Java API for XML Processing This API provides a common interface for creating and using the standard SAX, DOM, and XSLT APIs in Java, regardless of which vendor's implementation is actually being used. The main JAXP APIs are defined in the javax.xml.parsers package. That package contains two vendor-neutral factory classes: SAXParserFactory and DocumentBuilderFactory that give you a SAXParser and a DocumentBuilder, respectively. The DocumentBuilder, in turn, creates DOM-compliant Document object. The actual binding to a DOM or SAX engine can be specified using the System properties (but a default is provided). JAXP

J0 5 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento org.xml.sax Defines the basic SAX APIs. The "Simple API" for XML (SAX) is the event-driven, serial-access mechanism that does element-by-element processing. The API for this level reads and writes XML to a data repository or the Web. org.w3c.dom Defines the Document class (a DOM), as well as classes for all of the components of a DOM. The DOM API is generally an easier API to use. It provides a familiar tree structure of objects. You can use the DOM API to manipulate the hierarchy of application objects it encapsulates. The DOM API is ideal for interactive applications because the entire object model is present in memory, where it can be accessed and manipulated by the user. On the other hand, constructing the DOM requires reading the entire XML structure and holding the object tree in memory, so it is much more CPU and memory intensive. javax.xml.transform Defines the XSLT APIs that let you transform XML into other forms. JAXP – other packages

J0 6 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento SAX architecture SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(true); //optional - default is non-validating SAXParser saxParser = factory.newSAXParser(); saxParser.parse(File f, HandlerBase-subclass h) File containing input XML Document-handler (classe che implementa le callback) Interfaces implemented by HandlerBase class wraps

J0 7 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento SAX packages PackageDescription org.xml.sax Defines the SAX interfaces. The name "org.xml" is the package prefix that was settled on by the group that defined the SAX API. org.xml.sax.ext Defines SAX extensions that are used when doing more sophisticated SAX processing, for example, to process a document type definitions (DTD) or to see the detailed syntax for a file. org.xml.sax.hel pers Contains helper classes that make it easier to use SAX -- for example, by defining a default handler that has null-methods for all of the interfaces, so you only need to override the ones you actually want to implement. javax.xml.parse rs Defines the SAXParserFactory class which returns the SAXParser. Also defines exception classes for reporting errors.

J0 8 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento // ContentHandler methods void characters(char[] ch, int start, int length) void startDocument() void startElement(String name, AttributeList attrs) void endElement(String name) void endDocument() void processingInstruction(String target,String data)+ NOTE: In SAX2 startElement(String,AttributeList) has been deprecated and replaced by public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, Attributes attributes) Also, the class org.xml.sax. HandlerBase has been deprecated in SAX2, and replaced by org.xml.sax.helpers.DefaultHandler See the API for more details: SAX callbacks

J0 9 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento import java.io.*; import org.xml.sax.*; import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParser; public class CountSax extends HandlerBase { public static void main(String argv[]) throws Exception { if (argv.length != 1) { System.err.println("Usage: cmd filename"); System.exit(1); } // JAXP methods SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse(new File(argv[0]), new CountSax()); } SAX example Obtain a SAX parser, Parse the file

J0 10 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento static private int eltCount = 0; // ContentHandler methods public void startDocument() { eltCount = 0; } public void startElement(String name, AttributeList attrs) { eltCount++; } public void endDocument() { System.out.println("Total number of elements: " + eltCount); } SAX example Write the needed callback functions

J0 11 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento DOM architecture DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(true); // optional – default is non-validating DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(file);

J0 12 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento DOM packages PackageDescription org.w3c.dom Defines the DOM programming interfaces for XML (and, optionally, HTML) documents, as specified by the W3C. javax.xml.parsers Defines the DocumentBuilderFactory class and the DocumentBuilder class, which returns an object that implements the W3C Document interface. The factory that is used to create the builder is determined by the javax.xml.parsers system property, which can be set from the command line or overridden when invoking the newInstance method. This package also defines the ParserConfigurationException class for reporting errors.

J0 13 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento public interface Node The Node interface is the primary datatype for the entire DOM. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised. The attributes nodeName, nodeValue and attributes are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific nodeType (e.g., nodeValue for an Element or attributes for a Comment ), this returns null. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information. The Node interface

J0 14 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento public interface Document extends Node The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data. Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the Document interface also contains the factory methods needed to create these objects. The Node objects created have a ownerDocument attribute which associates them with the Document within whose context they were created. The Document interface

J0 15 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento The Node hierarchy Document Comment Text Entity Attr Node CharacterData hello mydocument comment Demo Aid=3 hello

J0 16 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento The Node hierarchy EntityReferenceProcessingInstructionDocumentType DocumentFragment Notation CDATASection Document CommentText Entity Attr Node CharacterData

J0 17 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Node: main methods NAVIGATION Node getParentNode() The parent of this node. NodeList getChildNodes() A NodeList that contains all children of this node. Node getFirstChild() The first child of this node. Node getLastChild() The last child of this node. Node getNextSibling() The node immediately following this node. Node getPreviousSibling() The node immediately preceding this node.

J0 18 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Node: WARNING! The implied semantic of this model is WRONG! You might deduce that a comment might contain another comment, or a document, or any other node! The integrity is delegated to a series of Nodes attributes, that the programmer should check.

J0 19 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento The Node interface InterfacenodeNamenodeValueattributes Attrname of attributevalue of attributenull CDATASection"#cdata-sectioncontent of the CDATA Section null Comment"#commentcontent of the commentnull Document"#documentnull DocumentFragment"#document-fragmentnull DocumentTypedocument type namenull Elementtag namenullNamedNodeMap Entityentity namenull EntityReferencename of entity referenced null Notationnotation namenull ProcessingInstructiontargetentire content excluding the target null Text"#textcontent of the text nodenull

J0 20 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Node: main methods INSPECTION int getNodeType() The type of this node java.lang.String getNodeName() The name of this node, depending on its type; see table. Short getNodeType() A code representing the type of the underlying object. java.lang.String getNodeValue() The value of this node, depending on its type; see the table. Document getOwnerDocument() The Document object associated with this node. Boolean hasAttributes() Returns whether this node (if it is an element) has any attributes. Boolean hasChildNodes() Returns whether this node has any children.

J0 21 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Node: main methods EDITING NODES Node cloneNode(boolean deep) Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. void setNodeValue(java.lang.String nodeValue) The value of this node, depending on its type; see the table.

J0 22 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Node: main methods EDITING STRUCTURE Node appendChild(Node newChild) Adds the node newChild to the end of the list of children of this node. Node removeChild(Node oldChild) Removes the child node indicated by oldChild from the list of children, and returns it. Node replaceChild(Node newChild, Node oldChild) Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. Node insertBefore(Node newChild, Node refChild) Inserts the node newChild before the existing child node refChild. void normalize() Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.

J0 23 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento Switch (node.getNodeType()) { case Node.ELEMENT_NODE; …; break; case Node.ATTRIBUTE_NODE; …; break; case Node.TEXT_NODE; …; break; case Node.CDATA_SECTION_NODE; …; break; case Node.ENTITY_REFERENCE_NODE; …; break; case Node.PROCESSING_INSTRUCTION; …; break; case Node.COMMENT_NODE; …; break; case Node.DOCUMENT_NODE; …; break; case Node.DOCUMENT_TYPE_NODE; …; break; case Node.DOCUMENT_FRAGMENT_NODE; …; break; case Node.NOTATION_NODE; …; break; default: throw (new Exception()); } NODE: determining the type

J0 24 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento import java.io.*; import org.w3c.dom.*; import org.xml.sax.*; // parser uses SAX methods to build DOM object import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; public class CountDom { /* the main method, just a test driver */ public static void main(String[] arg) throws Exception { if (arg.length != 1) { System.err.println("Usage: cmd filename (file must exist)"); System.exit(1); } Node node = readFile(new File(arg[0])); System.out.println(arg + " elementCount: " + getElementCount(node)); } DOM example

J0 25 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento public static Document readFile(File file) throws Exception { Document doc; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(true); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse(file); return doc; } catch (SAXParseException ex) { throw (ex); } catch (SAXException ex) { Exception x = ex.getException(); // get underlying Exception throw ((x == null) ? ex : x); } DOM example Parse File, Return Document

J0 26 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento public static int getElementCount(Node node) { if (null == node) return 0; int sum = 0; boolean isElement = (node.getNodeType() == Node.ELEMENT_NODE); if (isElement) sum = 1; NodeList children = node.getChildNodes(); if (null == children) return sum; for (int i = 0; i < children.getLength(); i++) { sum += getElementCount(children.item(i)); // recursive call } return sum; } DOM example use DOM methods to count elements: for each subtree if the root is an Element, set sum to 1, else to 0; add element count of all children of the root to sun

J0 27 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento JDOM: Java DOM (see The standard DOM is a very simple data structure that intermixes text nodes, element nodes, processing instruction nodes, CDATA nodes, entity references, and several other kinds of nodes. That makes it difficult to work with in practice, because you are always sifting through collections of nodes, discarding the ones you don't need into order to process the ones you are interested in. JDOM, on the other hand, creates a tree of objects from an XML structure. The resulting tree is much easier to use, and it can be created from an XML structure without a compilation step. DOM4J: DOM for Java (see Although it is not on the JCP (Java Community Process) standards track, DOM4J is an open-source, object-oriented alternative to DOM that is in many ways ahead of JDOM in terms of implemented features. As such, it represents an excellent alternative for Java developers who need to manipulate XML-based data. Alternatives to DOM

J0 28 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento TrAX TransformerFactory tf = TransformerFactory.newInstance(); StreamSource xslSS=new StreamSource(source.xsl); StreamSource xmlSS=new StreamSource(source.xml); Transformer t=tf.newTrasformer(xslSS); t.transform(xmlSS,new StreamResult(new FileOutputStream(out.html); java –Djavax.xml.transform.TransformerFactory= org.apache.xalan.processor.TrasformerFactoryImpl MyClass

J0 29 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento xml.transform packages PackageDescription javax.xml.transfo rm Defines the TransformerFactory and Transformer classes, which you use to get a object capable of doing transformations. After creating a transformer object, you invoke its transform() method, providing it with an input (source) and output (result). javax.xml.transfo rm.dom Classes to create input (source) and output (result) objects from a DOM. javax.xml.transfo rm.sax Classes to create input (source) from a SAX parser and output (result) objects from a SAX event handler. javax.xml.transfo rm.stream Classes to create input (source) and output (result) objects from an I/O stream.

J0 30 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento javax.xml.transform.Transformer transform(Source xmls, Result output) javax.xml.transform.sax.SAXResult implements Result javax.xml.transform.sax.SAXSource implements Source javax.xml.transform.stream.StreamResult implements Result javax.xml.transform.stream.StreamSource implements Source javax.xml.transform.dom.DOMResult implements Result javax.xml.transform. dom.DOMSource implements Source TrAX main classes

J0 31 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento JAXB: Java Architecture for XML Binding This standard defines a mechanism for writing out Java objects as XML (marshalling) and for creating Java objects from such structures (unmarshalling). JAXM: Java API for XML Messaging The JAXM API defines a mechanism for exchanging asynchronous XML-based messages between applications. ("Asynchronous" means "send it and forget it".) JAX-RPC: Java API for XML-based Remote Process Communications The JAX-RPC API defines a mechanism for exchanging synchronous XML- based messages between applications. JAXR: Java API for XML Registries The JAXR API provides a mechanism for publishing available services in an external registry, and for consulting the registry to find those services. Other Java-XML APIs