ÿþ<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=unicode" http-equiv=Content-Type> <META content="MSHTML 5.00.2314.1000" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY background=""> <DIV><FONT face="Comic Sans MS" size=2>Hi,</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; Thanks for ur response. But can u please help me in working out <U>the following example</U> from the book "Java and XML". I am having jaxp.jar,xalan.jar and crimson.jar downloaded from sun.java.com and installed as per them in jdk1.3\jre\lib\ext and the classpath was set exactly. Also I downloaded Xerces-J-bin.1.3.0.zip and also </FONT></DIV> <DIV><FONT size=2>Xerces-J-bin.2.0.0.alpha.zip, but not installed. Can u please help me in installing proper files in respective places and working properly with them and these examples.</FONT></DIV> <DIV><FONT size=2></FONT>&nbsp;</DIV> <DIV><FONT size=2><STRONG><U>The example program :</U></STRONG></FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT face="Comic Sans MS" size=2>import org.xml.sax.XMLReader;<BR>import javax.xml.parsers.SAXParser;<BR>public class SAXParserDemo<BR>{<BR>&nbsp; public void performDemo(String uri)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; System.out.println(" Parsing XML File : "+uri+"\n\n");<BR>&nbsp;&nbsp;&nbsp; XMLReader parser = new SAXParser();<BR>&nbsp;&nbsp;}<BR>&nbsp; public static void main(String[] a)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; if (a.length != 1)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Usage : java SAXParserDemo [XML URI]");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.exit(0);<BR>&nbsp;&nbsp;&nbsp; }</FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT face="Comic Sans MS" size=2>&nbsp;&nbsp;&nbsp; String uri = a[0];<BR>&nbsp;&nbsp;&nbsp; SAXParserDemo parserDemo = new SAXParserDemo();<BR>&nbsp;&nbsp;&nbsp; parserDemo.performDemo(uri);<BR>&nbsp; }<BR>}</FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT size=2>My actual problem is to parse <U>the following XML string</U> into java and to build a Hash Table Object with names as the element names and values as the values in between the tags.</FONT></DIV> <DIV><FONT size=2>The XML String of my problem :</FONT></DIV> <DIV><FONT size=2>&lt;aaaaa&gt;</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;bbbbb&gt; bbbbb_value &lt;/bbbbb&gt;</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;ccccc&gt; ccccc_value &lt;/ccccc&gt;</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;ddddd&gt; ddddd_value &lt;/ddddd&gt;</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;eeeee&gt;</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;fffff&gt; fffff_value &lt;/fffff&gt;</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ggggg&gt; ggggg_value &lt;/ggggg&gt;</FONT></DIV> <DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/eeeee&gt;</FONT></DIV> <DIV><FONT size=2>&lt;/aaaaa&gt;</FONT></DIV> <DIV><FONT size=2>I'll recieve the above xml part in String format (in java) and I've to parse it to get the &lt;bbbbb&gt; to &lt;/ddddd&gt; part and &lt;eeeee&gt; to &lt;/eeeee&gt; part seperately. In fact I don't need to seperate the contents of the &lt;eeeee&gt; &lt;/eeeee&gt; body and I need only the previous part of the XML String. Any one please mail me even if you have some code or example code for this task to be done. I'll be thankful for the help.</FONT></DIV> <DIV><FONT size=2>Thanks and regards,</FONT></DIV> <DIV><FONT size=2>D. Shiva.</FONT></DIV></BODY></HTML>

Reply via email to