my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes XML and Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML and Java" Watch "XML and Java" New topic
Author

XML and Java

Raheel
Greenhorn

Joined: Aug 06, 2001
Posts: 3
How can i use java with XML. If i want to parse the xml document with java code, then how it can be possible. Please let me know, if any1 knows about this. I'm aware of java and xml as well.
regards,
Raheel.
Varun_Pant
Greenhorn

Joined: Jul 19, 2001
Posts: 4
What you can do is really phenomenal.
Just for example, you can send the data input by a user in a webpage as a response to an event ( as a click of a button) as a �node� to the �Solver� which is written in Java, which can then retrieve the data stored in the node using
A sample code can run thus:
public String getDatabaseValues(Node eqNode, Document doc) {
//instantiate the variables
String st = ""; String st2 = ""; String st3 = "";
NamedNodeMap nm = eqNode.getAttributes();
//
if(nm.getNamedItem("Pfs")!=null){
st1 = nm.getNamedItem("NodeName").getNodeValue();
etc�etc..
Varun_Pant
Greenhorn

Joined: Jul 19, 2001
Posts: 4
DOM is the API for Document Object Model. DOM provides a representation of XML document as a tree, with data stored in the nodes: Each node representing a portion of data drawn from the original document.
Using a suitable XML parser , like Apache Xerces, one can create a DOM tree.
Refer any good book on DOM and parsing XML data.
jeremy crosbie
Greenhorn

Joined: Jun 20, 2001
Posts: 23
Originally posted by Varun_Pant:
DOM is the API for Document Object Model. DOM provides a representation of XML document as a tree, with data stored in the nodes: Each node representing a portion of data drawn from the original document.
Using a suitable XML parser , like Apache Xerces, one can create a DOM tree.
Refer any good book on DOM and parsing XML data.

You can also look into JDOM (www.jdom.org) which provides a more Java-centric and lightweight for of XML document handling. It is much easier to use than DOM for Java development with XML.

Jeremy Crosbie<BR>Co-Author of <A HREF="http://www.amazon.com/exec/obidos/ASIN/186100401X/ref=ase_electricporkchop" TARGET=_blank rel="nofollow">Professional Java XML</A>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML and Java