public synchronized void load(InputStream pInput) throws IOException {
    // Get parser instance
    XMLReader parser;

    // Try to instantiate System default parser
    String driver = System.getProperty("org.xml.sax.driver");

    if (driver == null) {

      // Instantiate the org.apache.xerces.parsers.SAXParser as default
      driver = "org.apache.xerces.parsers.SAXParser";
    }
    try {
      parser = XMLReaderFactory.createXMLReader(driver);
      parser.setFeature(SAX_VALIDATION_URI, mValidation);
    } catch (SAXNotRecognizedException saxnre) {

      // It should be okay to throw RuntimeExptions, as you will need an
      // XML parser
      throw new RuntimeException("Error configuring XML parser \"" + driver + "\": " + saxnre.getClass().getName() + ": "
                                 + saxnre.getMessage());
    } catch (SAXException saxe) {
      throw new RuntimeException("Error creating XML parser \"" + driver + "\": " + saxe.getClass().getName() + ": " + saxe.getMessage());
    }

    // Register handler
    PropertiesHandler handler = new PropertiesHandler(this);

    parser.setContentHandler(handler);
    parser.setErrorHandler(handler);
    parser.setDTDHandler(handler);
    parser.setEntityResolver(handler);

    // Read and parse XML
    try {
      parser.parse(new InputSource(pInput));
    } catch (SAXParseException saxpe) {

      // Wrap SAXException in IOException to be consistent
      throw new IOException("Error parsing XML: " + saxpe.getClass().getName() + ": " + saxpe.getMessage() + " Line: "
                            + saxpe.getLineNumber() + " Column: " + saxpe.getColumnNumber());
    } catch (SAXException saxe) {

      // Wrap SAXException in IOException to be consistent
      // Doesn't realy matter, as the SAXExceptions seems to be pretty
      // meaningless themselves...
      throw new IOException("Error parsing XML: " + saxe.getClass().getName() + ": " + saxe.getMessage());
    }
  }
public synchronized void load ( InputStream pInput ) throws IOException { XMLReader parser ; String driver = System . getProperty ( "org.xml.sax.driver" ) ; if ( driver == null ) { driver = "org.apache.xerces.parsers.SAXParser" ; } try { parser = XMLReaderFactory . createXMLReader ( driver ) ; parser . setFeature ( SAX_VALIDATION_URI , mValidation ) ; } catch ( SAXNotRecognizedException saxnre ) { throw new RuntimeException ( "Error configuring XML parser \"" + driver + "\": " + saxnre . getClass ( ) . getName ( ) + ": " + saxnre . getMessage ( ) ) ; } catch ( SAXException saxe ) { throw new RuntimeException ( "Error creating XML parser \"" + driver + "\": " + saxe . getClass ( ) . getName ( ) + ": " + saxe . getMessage ( ) ) ; } PropertiesHandler handler = new PropertiesHandler ( this ) ; parser . setContentHandler ( handler ) ; parser . setErrorHandler ( handler ) ; parser . setDTDHandler ( handler ) ; parser . setEntityResolver ( handler ) ; try { parser . parse ( new InputSource ( pInput ) ) ; } catch ( SAXParseException saxpe ) { throw new IOException ( "Error parsing XML: " + saxpe . getClass ( ) . getName ( ) + ": " + saxpe . getMessage ( ) + " Line: " + saxpe . getLineNumber ( ) + " Column: " + saxpe . getColumnNumber ( ) ) ; } catch ( SAXException saxe ) { throw new IOException ( "Error parsing XML: " + saxe . getClass ( ) . getName ( ) + ": " + saxe . getMessage ( ) ) ; } }
Reads a property list (key and element pairs) from the input stream. The
stream is assumed to be using the UFT-8 character encoding, and be in
valid, well-formed XML format.
<P/>
After loading, any errors or warnings from the SAX parser, are available
as array of SAXParseExceptions from the getXMLErrors and getXMLWarnings
methods.

@param pInput the input stream to load from.

@exception IOException if an error occurred when reading from the input
stream. Any SAXExceptions are also wrapped in IOExceptions.

@see Properties#load(InputStream)
@see #DTD
@see #SYSTEM_DTD_URI
@see XMLProperties.PropertiesHandler
@see #getXMLErrors
@see #getXMLWarnings