Code example for NamespaceSupport

0
    this.namespaceAware = namespaceAware;
    this.coalescing = coalescing;
    this.replacingEntityReferences = replacingEntityReferences;
    this.externalEntities = externalEntities;
    this.supportDTD = supportDTD;
    namespaces = new NamespaceSupport();
    events = new LinkedList();
     
    // Configure the SAX parser and perform the parse 
    try 
      { 
        SAXParserFactory f = SAXParserFactory.newInstance();
        f.setNamespaceAware(namespaceAware);
        f.setValidating(validating);
        SAXParser p = f.newSAXParser();
        XMLReader r = p.getXMLReader();
        CallbackHandler ch = this.new CallbackHandler(r);
        r.setFeature("http://xml.org/sax/features/external-general-entities", 
                     externalEntities);
        r.setFeature("http://xml.org/sax/features/namespaces", 
                     namespaceAware);