final String FEATURES = "http: final String PROPERTIES = "http: final String GNU_PROPERTIES = "http:  boolean standalone = reader.getFeature(FEATURES + "is-standalone"); doc.setXmlStandalone(standalone); try { String version = (String) reader.getProperty(PROPERTIES + "document-xml-version"); doc.setXmlVersion(version); } catch (SAXNotRecognizedException e) { } catch (SAXNotSupportedException e) { } if (locator != null && locator instanceof Locator2) { String encoding = ((Locator2) locator).getEncoding(); doc.setInputEncoding(encoding); } try { String encoding = (String) reader.getProperty(GNU_PROPERTIES + "document-xml-encoding"); doc.setXmlEncoding(encoding); } catch (SAXNotRecognizedException e) { } catch (SAXNotSupportedException e) { }
  public void startDocument()    throws SAXException  {    if (namespaceAware)      {        pending = new LinkedList();      }    doc = new DomDocument();    doc.setStrictErrorChecking(false);    doc.setBuilding(true);    ctx = doc;  }