Android Question Stop XML Parsing

RandomCoder

Well-Known Member
Licensed User
Longtime User
Happy New Year to all.

Please can you tell me if there is a way to stop parsing XML once a parameter has been found?

Thanks,
RandomCoder
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Thanks for confirming this Erel.

I am working on a UPNP client, my app downloads an XML file then searches for a parameter which once found gets a new XML file to search for more parameters. To do this I've set up another global XML parser. I now need to get more parameters from yet another XML file and so will need another global parser as there is no way to know if the other parsers have finished parsing the remainder of the XML that wasn't required. Is this the best way to proceed or can you advise of a better way? (I hope that makes reasonable sense)

Thanks,
RandomCoder
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Have you seen XOM library?

With XOM you load an XML document, access it's data using DOM tree traversal and then you're finished with it.
It's nothing like the B4A event based XML parser.

Martin.
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
Have you seen XOM library?

With XOM you load an XML document, access it's data using DOM tree traversal and then you're finished with it.
It's nothing like the B4A event based XML parser.

Martin.
No I had not seen this nor did I know that there are different ways of extrapolating XML data. Thank you Martin, I will definitely be having a play with it over the next few days.

Cheers,
RandomCoder
 
Upvote 0

urikupfer

Member
Licensed User
Longtime User
You can run the SaxParser (define it in a class) ,with a thread (the thread library) , surround the call with try catch, and in the SaxParser event throw exception (ExceptionEx from thread library), whenever you want.

It worked for me very well.
 
Upvote 0
Top