[jdom-interest] Newbie-Props

Brett McLaughlin brett at newInstance.com
Wed Sep 5 16:03:22 PDT 2001


You need jdom.jar and xerces.jar in your CLASSPATH environment variable.

---
Brett McLaughlin
Enhydra Strategist   http://www.enhydra.org
Lutris Technologies http://www.lutris.com
O'Reilly Author       http://www.oreilly.com/catalog/javaxml2
----- Original Message -----
From: "kaan" <derkaan at yahoo.de>
To: <jdom-interest at jdom.org>
Sent: Tuesday, September 04, 2001 10:24 AM
Subject: [jdom-interest] Newbie-Props


> Hi,
>
> i try to compile this example from the XML&Java-Book:
>
> import java.io.File;
> import java.io.IOException;
>
> import org.jdom.Document;
> import org.jdom.Element;
> import org.jdom.JDOMException;
> import org.jdom.input.SAXBuilder;
> import org.jdom.output.XMLOutputter;
>
> public class SAXTest {
>
>     public static void main(String[] args) {
>         if (args.length != 1) {
>             System.out.println("Usage: SAXTest
> [filename to parse]");
>             return;
>         }
>
>         try {
>             // Request document building without
> validation
>             SAXBuilder builder = new
> SAXBuilder(false);
>             Document doc = builder.build(new
> File(args[0]));
>             printDocument(doc);
>         } catch (JDOMException e) {
>             if (e.getRootCause() != null) {
>                 e.getRootCause().printStackTrace();
>             }
>             e.printStackTrace();
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
>
>     public static void printDocument(Document doc)
> throws IOException {
>         XMLOutputter fmt = new XMLOutputter();
>         fmt.output(doc, System.out);
>     }
> }
>
> but it doesn´t work.
> I get this Exception:
>
> cannot access org.xml.sax.InputSource
> file org\xml\sax\InputSource.class not found
>             Document doc = builder.build(new
> File(args[0]));
>                                   ^
>
> Can someone tell me what´s wrong?
> i´ve put the jdom.jar in the same directory where
> this source is....
>
> thanks,
> Kaan
>
> PS: i use the jdom-b7
>
>
> __________________________________________________________________
> Do You Yahoo!?
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com




More information about the jdom-interest mailing list