Hi,
    Thanks for ur response. But can u please help me in working out the
following example 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
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.

The example program :

import org.xml.sax.XMLReader;
import javax.xml.parsers.SAXParser;
public class SAXParserDemo
{
  public void performDemo(String uri)
  {
    System.out.println(" Parsing XML File : "+uri+"\n\n");
    XMLReader parser = new SAXParser();
  }
  public static void main(String[] a)
  {
    if (a.length != 1)
    {
      System.out.println("Usage : java SAXParserDemo [XML URI]");
      System.exit(0);
    }

    String uri = a[0];
    SAXParserDemo parserDemo = new SAXParserDemo();
    parserDemo.performDemo(uri);
  }
}

My actual problem is to parse the following XML string into java and to
build a Hash Table Object with names as the element names and values as the
values in between the tags.

The XML String of my problem :
<aaaaa>
        <bbbbb> bbbbb_value </bbbbb>
        <ccccc> ccccc_value </ccccc>
        <ddddd> ddddd_value </ddddd>
        <eeeee>
                <fffff> fffff_value </fffff>
                <ggggg> ggggg_value </ggggg>
        </eeeee>
</aaaaa>
I'll recieve the above xml part in String format (in java) and I've to parse
it to get the <bbbbb> to </ddddd> part and <eeeee> to </eeeee> part
seperately. In fact I don't need to seperate the contents of the <eeeee>
</eeeee> 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.
Thanks and regards,
D. Shiva.

Reply via email to