| Author |
Xml Parsing
|
vineet kumar chaudhry
Ranch Hand
Joined: Apr 02, 2011
Posts: 45
|
|
Hi Java Lovers
I have just started SAX Parsing in Java.
Now I wanna parse the particular group(like admin,contact etc) and get the passcount of that particulatr group only .For example if I a want admin details
I shoud get the following output
Please help me with it.
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
|
|
What do you have so far? Can you detect when a <Date> Element occurs?
Bill
|
Java Resources at www.wbrogden.com
|
 |
vineet kumar chaudhry
Ranch Hand
Joined: Apr 02, 2011
Posts: 45
|
|
I was using below code
It gives me the following output
admin
Date :--->
Passcount :--->
admin
Date :--->
Passcount :--->
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
|
|
Try not setting bfname or the other flags to false until the matching endElement() is called.
Note that the characters () method may be called multiple times inside a given Text node.
Bill
|
 |
g tsuji
Ranch Hand
Joined: Jan 18, 2011
Posts: 357
|
|
This is how it should be modified (overlapping what have been advised).
[1] If you want to use String s uniformly and generally in the handler, move the declaration outside of the startElement handling.
[2] In the same spirit of electing the flags in the startElement() because the detection in all cases of interested is on the element's name, you should take down the flags in the endElement().
[3] Flags shouldn't be switched in the characters handling.
|
 |
 |
|
|
subject: Xml Parsing
|
|
|