Yes, It is possible with the DOM and SAX to parse the XML having below
representation.
With the SAX, you can override startElement, endElement, characters
etc., APIs to parse the XML.Refer to the SAX documentation for more
information on SAX APIs. 

Also, with the DOM, the input XML will still be retained unless you
perform some changes to the DOM tree in memory and save the changes to
file. If the parsing involves only READ operation, I prefer SAX. If it
involves both READ and WRITE, DOM is the correct choice

Hope that helps.

Thanks,
Karuna 



-----Original Message-----
From: Coker, Jonathan M [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 22, 2007 2:49 PM
To: [email protected]
Subject: Parsing but want to save the orignal XML

Hello,
  I am parsing a file with data of the form <DataStream> <PlayerData id
= "1">
    <x>100</x>
    <y>50</y>
    <z>75</z>
</PlayerData>
<PlayerData id = "2">
    <x>100</x>
    <y>50</y>
    <z>75</z>
</PlayerData>
.
.
.
.

<DataStream>

with PlayerData repeated over and over.  I would like to use SAX to
parse it but retain the original XML to send elsewhere. Is this
possible?

Thank you

Reply via email to