Using java API for XML - samplesUsing java API for XML is very simple and straightforward. If you have already worked using document objects in other programming or scripting languages then this would be a breeze to you. A person having a basic knowledge on object oriented programming would find it very easy to work with this java API for XML. Lots of codes samples are found in the Sun website at the following URL. http://java.sun.com/developer/codesamples/xml.html. Using the DOM for working with an XML document is the easy way to work with. A document object is created and the XML file you want to work with is loaded in it. to create a document object you have to create a DocumentBuilderFactory and then a DocumentBuilder before you create a Document object. Proper imports are to be done to work with this APIs. To navigate through the nodes of the XML file, you can create a NodeList and load the elements using the getElementByTagName() method. Then you can navigate through the node list and display them. Lots of samples on using the java API is available in the internet.
|
|
|||
|
||||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.