Hi, I have an XML file that looks like this <?xml version="1.0"?> <RESPONSE> <FEATURES> <FEATURE> <FIELDS CUST_ID="4" NAME="Customer" #SHAPE#="[Geometry]" #ID#="3" /> <FIELDS CUST_ID="5" NAME="Customer1" #SHAPE#="[Geometry]" #ID#="3" /> <FIELDS CUST_ID="6" NAME="Customer2" #SHAPE#="[Geometry]" #ID#="3" /> <FIELDS CUST_ID="7" NAME="Customer3" #SHAPE#="[Geometry]" #ID#="3" /> </FEATURE> </RESPONSE> How do I extract the fields from this XML file ? How can I represent the data in this in an HTML format ? ie, CUST_ID Name SHAPE ID and the values one by one inside each colums How will I do it ? Thanks, Maya
To extract values out of this XML doc, you would have to use a XML DOM Parser. There are many parsers available like xml4j from IBM. These parsers would read the inputstream and give you a Document object back. From this Document object you can extract the Elements, attributes etc .. using the API. From representing this XML doc as a HTML doc, you will have to create a XSL. Microsoft may have tutorials on how to write XSL's. If the XML doc refers to a XSL and if you use IE to read the XML, it would automatically display the intended HTML. With Netscape, you would have to the transformation server side.
Joined: Jul 31, 2001