Results 1 to 4 of 4
- 01-18-2010, 06:19 PM #1
Member
- Join Date
- Nov 2008
- Posts
- 3
- Rep Power
- 0
- 01-28-2010, 08:43 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Supply the parser with your own DefaultHandler; the parser will call your startElement method when it enters a node and call endElement when it leaves a node. Keep track of a counter and increment it when entering a node and decrement it when the parse leaves a node. Only print the node content when the counter == 1.
kind regards,
Jos
- 01-28-2010, 10:31 PM #3
Member
- Join Date
- Nov 2008
- Posts
- 3
- Rep Power
- 0
hi, thanks I have achieved this now but I have an xml file with many of one 'item' with many inner nodes. It only seems to count the first 'item' so will only print from one 'item' not all. Am I doing something wrong
e.g.
<Items>
<Item>
<example node></example node>
<example node></example node>
<example node></example node>
</Item>
<Item>
<example node></example node>
<example node></example node>
<example node></example node>
</Item>
</Items>
- 01-29-2010, 08:05 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
read nodes with same name but different atributes
By pankaj_salwan in forum XMLReplies: 0Last Post: 07-15-2009, 01:46 PM -
How to dynamically add Nodes to JTree?
By javanewbie in forum AWT / SwingReplies: 3Last Post: 07-13-2009, 07:20 AM -
nodes
By Dr Gonzo in forum New To JavaReplies: 1Last Post: 12-08-2008, 04:22 PM -
nodes in java netowork
By ahsan in forum Advanced JavaReplies: 0Last Post: 12-26-2007, 03:11 PM -
nodes in java
By ahsan in forum New To JavaReplies: 0Last Post: 12-26-2007, 03:09 PM


LinkBack URL
About LinkBacks


Bookmarks