Re: Parsing HTML
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.xmlc |
|---|---|
| Message-ID | <[email protected]> |
You might be able to try something like the code at this link.. http://www-106.ibm.com/developerworks/xml/library/x-tipboot2.html set the DOMImplementation class to that of the html DOM implementation class. Now things should work for you loading up plain HTML. Jake At 02:02 PM 3/24/2003 -0600, you wrote: >I often work with XML, so I know how to load an XML file. Unfortunately, >other people will be creating these headers and footers using normal HTML >editors, and I don't want to force them to use XHTML if they don't want to >or know how. > >Maybe I could convert the HTML to XHTML on the fly when I need to. > >At 01:43 PM 3/24/2003, you wrote: > >>Here is an example of creating a Document from a file....of course this >>example assumes the file is valid XML.... >> >>DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance(); ... > >>I'm not sure how to modify this example to load a valid HTML4 file? If >>you use this example, your file will have to be XHTML valid...meaning >>that all tags which are opened must then be closed. If you come up with >>a way to do this with a non-XML-compliant HTML file, I'd appreciate it if >>you posted the example back to the list. > >-- >Ben Sinclair >[email protected] >_______________________________________________ >XMLC mailing list >[email protected] >http://www.enhydra.org/mailman/listinfo.cgi/xmlc