View Single Post
  #1 (permalink)  
Old 07-04-2007, 10:15 AM
Jack Jack is offline
Senior Member
 
Join Date: Jun 2007
Posts: 130
Jack is on a distinguished road
Parse XMLfile as String using SAX parser
Hi
I am trying to use SAX parser.

Here is the requirement
I will get the XML file as string from a third party application. Now I need to get the java objects out of this String by using SAX parser.

Sample XML string as below.
Code:
String xmlString="<?xml version="1.0" encoding="UTF-8"?><response><record><Id>04334</Id> <Type>A</Type><effectiveDate /><lastModifiedDate>2006-04-03 00:00:00</lastModifiedDate> <modifiedBy>GH002</modifiedBy> <associatedSisId /><risk><namedInsured> <firstName>Barney</firstName><lastName>Rubble </lastName> </namedInsured><address><street1>123 Easy Street</street1> <street2>Apartment 5</street2><city>Madras</city> <state>TN</state><zip5>55345340</zip5> <zip4>2333</zip4></address></risk></record>"
I need parse this using SAX and get the values out of it.
thanks
Reply With Quote
Sponsored Links