Results 1 to 3 of 3
Thread: Print XML tag
- 08-07-2007, 05:27 PM #1
Print XML tag
Hey,
I have written some java code to Parse an XML file.
It is almost exactly the same as the code here:
A Simple Way to Read an XML File in Java - Print Version
Basically, I have it returning the XML values but what I want to be able to do now is to return the actual tag.
So if we have:
<age>22</age>
I have the code which will return: 22
Now I need the code to show the actual TAG: <age>
Does anyone know how this can be done????
THANKS!!!!!!
- 08-07-2007, 05:52 PM #2
Senior Member
- Join Date
- Mar 2007
- Posts
- 134
- Rep Power
- 0
Assumes this is printing the age Change like thisJava Code:System.out.println("Age : " + ((Node)textAgeList.item(0)).getNodeValue().trim());
XMLString() will return an xmlstring just remove the "<?xml version="1.0"?>" so we added the substring functionJava Code:System.out.println("Age : " + ((Node)textAgeList.item(0)).asXMLString().subString(55));
- 08-07-2007, 06:02 PM #3
Similar Threads
-
print line
By kazitula in forum Java AppletsReplies: 2Last Post: 01-26-2008, 02:05 PM -
Print Area
By Riftwalker in forum Advanced JavaReplies: 0Last Post: 11-28-2007, 07:28 PM -
doubt about PRINT API
By valery in forum New To JavaReplies: 1Last Post: 08-06-2007, 09:51 PM -
Print A Pdf
By Jack in forum Advanced JavaReplies: 2Last Post: 07-02-2007, 05:40 AM -
print .doc in java
By Alan in forum Advanced JavaReplies: 1Last Post: 05-17-2007, 04:05 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks