Parsing XML Doc with JAXP

I am getting "Array out of bound exception" while parsing XML document, any idea?

Code is

-

import java.io.*;

import java.util.*;

public class MyTestDriver {

public static void main(String argv[]) {

String file = new String(argv[0]);

MySAXParserBean p = new MySAXParserBean();

String str = null;

try {

Collection v = p.parse(file);

Iterator it = v.iterator();

while(it.hasNext()) {

MyElement element =

(MyElement)it.next();

String tag = element.getLocalName();

if(tag.equals("symbol")) {

System.out.println("Symbol:

" + element.getValue());

} else if(tag.equals("name")) {

System.out.println("Name: "

+element.getValue());

} else if (tag.equals("price")) {

System.out.println("Price: "

+element.getValue());

}

}

} catch (Exception e) {

}

}

}

[948 byte] By [Kash31a] at [2007-10-2 13:53:23]
# 1
At this line here?String file = new String(argv[0]);If so, that's because you forgot to pass the file name as the command-line argument to your program.
DrClapa at 2007-7-13 11:55:51 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...