Re: Parsing HTML
Ben Sinclair <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.xmlc |
|---|---|
| Message-ID | <[email protected]> |
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]