You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Eric Ye <er...@locus.apache.org> on 2000/10/02 20:14:49 UTC

Re: Using the Xerces Parser

What is the uri that was kicked out?
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Sivakumar Boraiyan" <SB...@ctisinc.com>
To: "'Eric Ye'" <er...@locus.apache.org>
Sent: Monday, October 02, 2000 7:00 AM
Subject: RE: Using the Xerces Parser


> Hi Eric,
>    Thanks for this help.
>  I Had installed Xercer-J and Mentioned the classpath. It is working. I
> wrote a simple program , to parse an XML document. My program caught a
> SAXParserException and the message was " File not found". I checked the
URI
> I passed and it seems to be OK. What could be the problem. the following
> code is the Java program I used for experimenting.
>
>
> import org.xml.sax.XMLReader;
> import org.apache.xerces.parsers.SAXParser;
> import java.io.IOException;
> import org.xml.sax.SAXException;
> /**
>  *   <b><code>SAXParserDemo</code></b>will take an XML file and Parse it
>  *   using SAX, displaying the callbacks ain the parsing lifecyle.
>  *   @autor
>  *        <a href="mailto:brettmclaughlin@earthlink.net">Brett
> McLaughlin</a>
>  *   @version1.0
>  */
> public class SAXParserDemo{
>
>     /** Creates new SAXParserDemo */
>
>     /**
>      *   <p>
>      *   This parses the file, using the registered SAX handlers and
outputs
>      *   the events in the parsing cycle.
>      *   </P>
>      *
>      */
>
>  public void performDemo(String uri) {
>         System.out.println("Parsing a XML file: "+ uri +"\n\n");
>
>         try{
>         // instantiate a parser
>         XMLReader parser = new SAXParser();
>
>         file://parse the document
>
>         parser.parse(uri);
>
>         }catch(IOException e){
>             System.out.println("Error reading uri :" + e.getMessage());
>         }catch(SAXException e){
>             System.out.println("Error in parsing : " +
> e.getMessage());-----------> this is the error message I get.
>         }
>     }
>
>
>     /**
>      * <p>
>      * This provides command line entry point  for this demo.
>      * </P>
>      */
>
>     public static void main(String[] args){
>         if(args.length != 1){
>             System.out.println("usage : Java SAXPArserDemo[XML URI]");
>             System.exit(0);
>
>         }
>
>         String uri = args[0];
>         SAXParserDemo parserDemo = new SAXParserDemo();
>         parserDemo.performDemo(uri);
>     }
>
> }
>
> I am new Java Developer.
> Thanks once again.
>
> Sivakumar Boraiyan.
>
> -----Original Message-----
> From: Eric Ye [mailto:ericye@locus.apache.org]
> Sent: Friday, September 29, 2000 1:06 PM
> To: xerces-dev@xml.apache.org; Harry Lin; SBORAIYAN.cfandm@ctisinc.com
> Subject: Re: Using the Xerces Parser
>
>
>
> >
> >
> > > Hi ,
> > >    I am trying to use the Xerces parser. I downloaded the
> > > xerces-j-bin.1.2.0.zip file from the xerces web site and used the
> command
> > > line command   jar xf xerces-j-bin.1.2.0.zip to extract the files. It
> did
>
> Have you tried unzip or winzip
>
> > > gave me a sub directory containg the xerces.jar file. I mentioned the
> > > complete path  of Xerces.jar in the environment entries in my Windows
NT
>
> What entries? it should be the "classpath" environment variable.
>
> > > operating system. I tried compiling an XML program which uses the SAX
> > > interface and a Class( SAXParser, XMLReader). I get  errors stating "
> can
> > > not resolve symbol". Can you help me?
> > >
> > > Sivakumar.
> > >
> >
> >
>
> Most people find it very easy to deploy Xerces-J on WinNT.
> No offense, are you a new java developer?
>
> Best regards
> Eric
>