| | |
How to read the parsed XML file (DOM parser)
![]() |
•
•
Join Date: May 2007
Posts: 3
Reputation:
Solved Threads: 0
Hi..
I have parsed a XML file with the DOM parser.
I need assistance in reading the parsed content ...and then preform actions in my java program accrodingly..
Now what i have to do is print some text depending on the value that is ther in the xml element.
for ex:.
i want to do something like this:
if element value from XML = "button" ,then my JAVA prgrm shud print " This is button"
as i am new to JAVA; can any body please help me..i am stuck up here.
if some one can suggest any tutorials with which i can learn how to do this..that wud be nice.
I have parsed a XML file with the DOM parser.
I need assistance in reading the parsed content ...and then preform actions in my java program accrodingly..
Now what i have to do is print some text depending on the value that is ther in the xml element.
for ex:.
i want to do something like this:
if element value from XML = "button" ,then my JAVA prgrm shud print " This is button"
as i am new to JAVA; can any body please help me..i am stuck up here.
if some one can suggest any tutorials with which i can learn how to do this..that wud be nice.
Shriyash.
The DOM API has methods for retrieving sets of child elements from an element given that elements tag name.
You can also retrieve the values of attributes by attribute name.
Using those and given knowledge about the structure of the XML you can address any node/element in the parsed Document.
Some experimenting and reading of the API documentation goes a long way towards understanding how it works.
You may also look at http://xerces.apache.org/xerces2-j/ for tutorials (mind that they may need some modification in details to work with the built-in XML functionality of the core libraries, but the general idea is the same).
You can also retrieve the values of attributes by attribute name.
Using those and given knowledge about the structure of the XML you can address any node/element in the parsed Document.
Some experimenting and reading of the API documentation goes a long way towards understanding how it works.
You may also look at http://xerces.apache.org/xerces2-j/ for tutorials (mind that they may need some modification in details to work with the built-in XML functionality of the core libraries, but the general idea is the same).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- Read XML File in C/C++ (C++)
- [urgent] HTML form => XML file (JSP)
- Read and parse and xml file from an ftp server (PHP)
- unable to read wesite uploaded XML file (C#)
- How to Parse XML file (RSS, Web Services and SOAP)
- Need some help with parsing an XML file (PHP)
- Cannot load XML file. (PHP)
- Parsing xml file (Python)
Other Threads in the Java Forum
- Previous Thread: How to sign an email using an API
- Next Thread: how to simulate cpu scheduling
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card class client code collision component crashcourse css csv database eclipse ee error fractal free ftp game gis givemetehcodez graphics gui html ide image integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linked linux list loan machine map method methods migrate mobile netbeans objects oriented output phone physics printf problem program programming project projects radio recursion replaydirector reporting researchinmotion rotatetext scanner se server service set sms software sort sql string swing test textfield threads tree trolltech ubuntu utility windows






