Understanding Java API for XML processing (JAXP) If you want to process XML document using Java, then you can use JAXP. JAXP stands for Java API for XML Processing. You can download these API from the Sun website sun.com. You can get the specifications and also the source code from the website. JAXP has a set of classes and methods that are used to process XML documents. Classes to create DocumentBuilderFactory, DocumentBuilder, and Documents are available. There are methods to create elements, get all the elements of an XML document by tag names, create text nodes, and to append the text nodes to the root nodes or other elements. Element rt = (Element) doc.createElement("book"); Consider the above two statements that is used as a part of a java program used to handle the XML documents. The first statement creates an element that is supposed to the root element and the next statement adds a text node to it. The 'doc' is the document object that was previously created. To create a document object you have to create DocumentBuilderFactory and then a DocumentBuilder. Lots of samples are available in the internet.
|
|
||
|
|||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.