[jdom-interest] JDOM Exception??

Jay Di Silvestri jay at adei.com
Wed Jun 21 07:34:07 PDT 2000


I have this same issue. If I move the source file I get a different
exception, so I know it sees the data, but this is all I can get it to spit
out.

Jay Di Silvestri
Executive Vice President
Advanced Data Engineering
1310 Redwood Way, Suite 120
Petaluma, CA 94954
(707) 794-7000 x23 
jay at adei.com




-----Original Message-----
From: RYAN HERRING [mailto:RYAN.HERRING at morningstar.com]
Sent: Friday, June 16, 2000 2:06 PM
To: 'jdom-interest at jdom.org'
Subject: [jdom-interest] JDOM Exception??


Hi,

I'm new to JDOM and I'm trying to run the PrettyPrinter example.  It
compiles, but when I try to run it, I get this error message:

D:\JavaXML\JDom>java JDomTest2 jreport.xml
org.jdom.JDOMException: String index out of range: 0: String index out of
range: 0
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:229)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:284)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:265)
        at JDomTest2.main(JDomTest2.java:18)
Root cause: java.lang.StringIndexOutOfBoundsException: String index out of
range: 0
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:834)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:218)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:284)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:265)
        at JDomTest2.main(JDomTest2.java:18)

I'm using a sample XML file that I created, and I'm using that as my command
line argument.  Also, here is my source code:

import java.io.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;

public class JDomTest2 {
	public static void main(String[] args) {

		// filename argument
		String filename = args[0];
		try {
			// build the document with SAX and Xerces, no
validation
			SAXBuilder builder = new SAXBuilder();
			//Create the document
			Document doc = builder.build(new File(args[0]));

			//output the document
			XMLOutputter fmt = new XMLOutputter();
			fmt.output(doc, System.out);
		} catch (Exception e) {
			 e.printStackTrace();
		}
	}
}

Thanks in advance - Ryan Herring
_______________________________________________
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