Results 1 to 6 of 6
Thread: Searching XML file using DOM
- 07-13-2007, 02:36 PM #1
Member
- Join Date
- Jul 2007
- Posts
- 44
- Rep Power
- 0
Searching XML file using DOM
I have an XML file that I read using DOM. The file is that:
I want to be able to retrieve the element where id=xxxx. And I should also be able to access the elements that are in the object element I found.Java Code:<database> <object id="0001"> more elements here </object> <object id="0002"> more elements here </object> and so on.... </database>
can I do that?
thank you
- 07-14-2007, 11:55 PM #2
Member
- Join Date
- Jul 2007
- Posts
- 39
- Rep Power
- 0
I think it is better to use SAX than DOM to search the xml file if the xml is going to be to big and it will work fast.
- 07-30-2007, 11:55 PM #3
Senior Member
- Join Date
- Jul 2007
- Posts
- 135
- Rep Power
- 0
You can also use XPath to get what you want.
- 08-01-2007, 04:38 PM #4
Member
- Join Date
- Jul 2007
- Posts
- 44
- Rep Power
- 0
Thanks guys, I finally used XPath.
- 10-28-2008, 08:06 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Actually use XPath is much easier. Quite similar question discuss here few days back, how to update an XML file. Same procedure have to follow.
- 03-30-2009, 01:27 AM #6
Member
- Join Date
- Mar 2009
- Posts
- 10
- Rep Power
- 0
Similar Threads
-
Searching an arraylist
By adelgado0723 in forum New To JavaReplies: 1Last Post: 04-15-2008, 01:09 PM -
Sorting, Searching, and Inserting into a sorted array
By Java Tip in forum java.langReplies: 0Last Post: 04-14-2008, 08:39 PM -
recursively searching through arraylists
By newtojava7 in forum New To JavaReplies: 1Last Post: 03-17-2008, 02:36 AM -
searching within a JList
By newtojava7 in forum New To JavaReplies: 1Last Post: 03-10-2008, 12:12 AM -
searching
By nalinda in forum New To JavaReplies: 3Last Post: 12-06-2007, 02:56 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks