65 |
import org.xml.sax.SAXParseException; |
import org.xml.sax.SAXParseException; |
66 |
import org.xml.sax.XMLReader; |
import org.xml.sax.XMLReader; |
67 |
import gnu.xml.dom.DomDocument; |
import gnu.xml.dom.DomDocument; |
68 |
import gnu.xml.dom.DomEx; |
import gnu.xml.dom.DomDOMException; |
69 |
|
|
70 |
/** |
/** |
71 |
* Parser implementation for GNU DOM. |
* Parser implementation for GNU DOM. |
117 |
async = false; |
async = false; |
118 |
break; |
break; |
119 |
default: |
default: |
120 |
throw new DomEx(DOMException.NOT_SUPPORTED_ERR); |
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); |
121 |
} |
} |
122 |
// TODO schemaType |
// TODO schemaType |
123 |
this.schemaType = schemaType; |
this.schemaType = schemaType; |
307 |
{ |
{ |
308 |
reader = null; |
reader = null; |
309 |
eventSink = null; |
eventSink = null; |
310 |
throw new DomLSEx(LSException.PARSE_ERR, e); |
throw new DomLSException(LSException.PARSE_ERR, e); |
311 |
} |
} |
312 |
catch (IOException e) |
catch (IOException e) |
313 |
{ |
{ |
314 |
reader = null; |
reader = null; |
315 |
eventSink = null; |
eventSink = null; |
316 |
throw new DomLSEx(LSException.PARSE_ERR, e); |
throw new DomLSException(LSException.PARSE_ERR, e); |
317 |
} |
} |
318 |
// return document |
// return document |
319 |
Document ret = eventSink.doc; |
Document ret = eventSink.doc; |
341 |
} |
} |
342 |
catch (ParserConfigurationException e) |
catch (ParserConfigurationException e) |
343 |
{ |
{ |
344 |
throw new DomLSEx(LSException.PARSE_ERR, e); |
throw new DomLSException(LSException.PARSE_ERR, e); |
345 |
} |
} |
346 |
catch (SAXException e) |
catch (SAXException e) |
347 |
{ |
{ |
348 |
throw new DomLSEx(LSException.PARSE_ERR, e); |
throw new DomLSException(LSException.PARSE_ERR, e); |
349 |
} |
} |
350 |
} |
} |
351 |
return reader; |
return reader; |
371 |
} |
} |
372 |
catch (SAXException e) |
catch (SAXException e) |
373 |
{ |
{ |
374 |
throw new DomLSEx(LSException.PARSE_ERR, e); |
throw new DomLSException(LSException.PARSE_ERR, e); |
375 |
} |
} |
376 |
catch (IOException e) |
catch (IOException e) |
377 |
{ |
{ |
378 |
throw new DomLSEx(LSException.PARSE_ERR, e); |
throw new DomLSException(LSException.PARSE_ERR, e); |
379 |
} |
} |
380 |
} |
} |
381 |
if (source == null) |
if (source == null) |
403 |
} |
} |
404 |
catch (IOException e) |
catch (IOException e) |
405 |
{ |
{ |
406 |
throw new DomLSEx(LSException.PARSE_ERR, e); |
throw new DomLSException(LSException.PARSE_ERR, e); |
407 |
} |
} |
408 |
} |
} |
409 |
return source; |
return source; |
457 |
} |
} |
458 |
else |
else |
459 |
{ |
{ |
460 |
throw new DomEx(DomEx.NOT_SUPPORTED_ERR); |
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); |
461 |
} |
} |
462 |
// invalidate reader, a new one will be created |
// invalidate reader, a new one will be created |
463 |
reader = null; |
reader = null; |
509 |
} |
} |
510 |
else |
else |
511 |
{ |
{ |
512 |
throw new DomEx(DomEx.NOT_SUPPORTED_ERR); |
throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); |
513 |
} |
} |
514 |
} |
} |
515 |
|
|