private class XMLHelper extends XML {
Vector obStack = new Vector();
public XMLHelper() { super(BUFFER_SIZE); }
- public void startElement(XML.Element c) throws XML.SchemaException {
+ public void startElement(XML.Element c) throws XML.Exn {
try {
JS o = new JS();
- o.put("$name", c.localName);
- for(int i=0; i<c.len; i++) o.put(c.keys[i], c.vals[i]);
+ o.put("$name", c.getLocalName());
+ for(int i=0; i < c.getAttrLen(); i++) o.put(c.getAttrKey(i), c.getAttrVal(i));
o.put("$numchildren", new Integer(0));
obStack.addElement(o);
} catch (JSExn jse) {
throw new Error("this should never happen");
}
}
- public void endElement(XML.Element c) throws XML.SchemaException {
+ public void endElement(XML.Element c) throws XML.Exn {
try {
if (obStack.size() == 1) return;
JS me = (JS)obStack.lastElement();
throw new Error("this should never happen");
}
}
- public void characters(char[] ch, int start, int length) throws XML.SchemaException {
+ public void characters(char[] ch, int start, int length) throws XML.Exn {
try {
String s = new String(ch, start, length);
JS parent = (JS)obStack.lastElement();
try {
BufferedReader r = new BufferedReader(new InputStreamReader(is));
parse(r);
- } catch (XML.XMLException e) {
+ } catch (XML.Exn e) {
throw new JSExn("error parsing XML: " + e.toString());
} catch (IOException e) {
if (Log.on) Log.log(this, "IO Exception while reading from file");