parser.parse(new InputSource(new StringInputStream(contents)));
parser.parse(new InputSource(new StringReader(contents)));
  public boolean validateContentsSinglePass(String contents) throws XMLDBException {	  try {	    XMLParserConfiguration config = new XML11Configuration();	    GenericSchemaServiceXMLGrammarPool grammarPool = new GenericSchemaServiceXMLGrammarPool(this);	    config.setProperty("http://apache.org/xml/properties/internal/grammar-pool", grammarPool);	    SAXParser parser = new SAXParser(config);	    	    ValidationErrorHandler errorHandler = new ValidationErrorHandler();	    parser.setErrorHandler(errorHandler);	    parser.parse(new InputSource(new StringInputStream(contents)));	    if (errorHandler.getErrors().size() > 0)	      throw errorHandler.toException();	    return true;	  } catch (SAXException e) {	    throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "SAX error reading contents.", e);	  } catch (IOException e) {	    throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "IO error reading contents", e);	  }	}