| Author |
SAx and XML
|
francis varkey
Ranch Hand
Joined: Sep 13, 2005
Posts: 155
|
|
Respected Sirs, Is it possible to, using the SAX approach, extract the XML content between an opening and closing tag as if it was a continuous string of text? For example, let's say we have the following document: <one> <two> <three>data one</three> <four>data two</four> </two> </one> Is it possible to directly extract the content between <one> and </one> as if it was a text string? Thanks Francis
|
 |
Gamini Sirisena
Ranch Hand
Joined: Aug 05, 2008
Posts: 347
|
|
Yes you can. But there's a small catch. Check this thread.
|
 |
Gamini Sirisena
Ranch Hand
Joined: Aug 05, 2008
Posts: 347
|
|
oops sorry.. misread the question.. well you could always code for such logic..
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
Gamini is right, the answer is "yes". But if you can't see how, I would suggest you convert a start-element event to a string containing a representation of an element's start tag, and so on. You won't necessarily get an exact representation of what's there, for example you may get attributes in a different order and you may represent empty elements differently, but that's allowed by the rules of XML.
|
 |
 |
|
|
subject: SAx and XML
|
|
|