XML Manipulation with Apache AXIOM New Mexico

Explore how to process Axiom and how to serialize Axiom into an output stream. Also learn to use the Axiom APIs for processing SOAP.

Local Companies

Action Coach New Mexico
505-798-2552
4801 Lang Ave. Suite 110
Albuquerque, NM
Hogan Industries
(505) 368-4014
Shiprock, NM
Medical Business Services
(505) 983-1533
4001 Office Ct
Santa Fe, NM
Score
(505) 523-5627
505 S Main St
Las Cruces, NM
Bridging Associates
(505) 988-4890
Santa Fe, NM
Collaborative Solutions
505-292-9949
3713 Mt. Rainier Dr. N.E.
Albuquerque, NM
Redfish Group
(505) 995-0206
624 Agua Fria St
Santa Fe, NM
Experior Assessments Llc
(505) 473-9351
2538 Camino Entrada
Santa Fe, NM
Vision Quest Inc
(505) 242-8803
Albuquerque, NM
Cornerstone Business Solutions
(505) 325-4900
Farmington, NM

With the popularity of Apache Axis2, Axiom also got a good attention. One of the cool things is that you don't need to have Axis2 to use Axiom, you can download Axiom separately and use specifically. Axiom is used in a number of Apache project and other project in addition to Apache Axis2. In the first part of the article I discussed Pull and Push parser technology as well as gave an Axiom overview. I also showed how to create Axiom in various ways and how to work with attributes and namespaces. So if you followed the first part, then you have good background knowledge to follow this article. If you have not followed the first part then it is recommended that you read it before continuing.



Tree Navigation


Navigating the object structure can be done in the usual way by using the list of children (similar to any of the XML processing tool). However in Axiom, the child nodes are returned as an iterator. The idea of iterator is to support “Pull parsing” and ”On-Demand” building, so only the element you asked for will be read into the memory. Others will remain untouched. The following code sample shows how the children can be accessed. The children are of the type OMNode and can either be of type OMText or OMElement.

Get all Nodes



Iterator children = root.getChildren();
while(children.hasNext()){
OMNode node = (OMNode)children.next();
}


Get Only Elements


You can use following code to all child OMElement for a given Element, in this case you will not get any OMText element.




Iterator children = root.getChildElements();
while(children.hasNext()){
OMElement node = (OMElement)children.next();
}


Get Element by Name


Read the Rest of this Article at Developer.com

Featured Local Company

Collaborative Solutions

505-292-9949
3713 Mt. Rainier Dr. N.E.
Albuquerque, NM

Related Articles
- Apache AXIOM New Mexico
Apache AXIOM (AXis2 Object Model) is a pull-based, XML Infoset-compliant object model that supports on-demand building of the object tree. Learn the basis of Axiom and how to use it.
- "Just Add Linux": The Union of Commercial and Open Source Software into Existing Business Models New Mexico
Related Articles
- Apache AXIOM New Mexico
Apache AXIOM (AXis2 Object Model) is a pull-based, XML Infoset-compliant object model that supports on-demand building of the object tree. Learn the basis of Axiom and how to use it.
- "Just Add Linux": The Union of Commercial and Open Source Software into Existing Business Models New Mexico

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML