This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com