The following program works correctly with xerces-1.4.4, but not 
with 2.0.1. Is this a bug?


import org.w3c.dom.*;
import org.w3c.dom.html.*;
import org.apache.html.dom.*;
import org.apache.xerces.parsers.*;
import org.xml.sax.*;
import java.io.StringReader;
 
public class TestHtml {
 
        public static void main (String[] args)
        {
                String html = "<html><head><title>T</title></head><body>hello 
</body></html>";
                DOMParser domp = new DOMParser();
                try {
                
domp.setProperty("http://apache.org/xml/properties/dom/document-class-name";,
                                "org.apache.html.dom.HTMLDocumentImpl");
 
                        domp.parse(new InputSource(new StringReader (html)));
                }
                catch (Exception e) {
                        System.out.println ("Error in parsing "+ 
e.getMessage());
                }
                HTMLDocument d = (HTMLDocument)domp.getDocument();
                System.out.println ("Title: "  + d.getTitle());
                System.out.println ("#forms: " + d.getForms().getLength());
 
 
        }
 
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to