Re: parsing xHTML

Jacob Kjome <[email protected]> Sun, 14 Sep 2003 20:02:48 -0500
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
By default, XMLC uses an HTML parser.  Try using "-dom xhtml" or doing 
"-domfactory org.enhydra.xml.xhtml.XHTMLDomFactory" (which is functionally 
the same as the former) ...or use "-domfactory 
org.enhydra.xml.xhtml.HTMLDomFactory which is almost the same as the 
XHTMLDomFactory, but defaults to the text/html mime type where the former 
defaults to application/xml+xhtml and the most classes implement 
HTMLElement rather than the custom XHTML element interfaces.  Just depends 
on your needs.

You probably also need to specify a different parser which supports 
XML.  Try using "-parser xerces".  It is actually the jtidy parser (which 
only understands HTML, not XML) which is "fixing" up your invalid HTML.

Jake

At 03:35 PM 9/14/2003 -0700, you wrote:
>I was playing around with XMLC a bit this afternoon and discovered that 
>XMLC was outputting incorrect HTML when my input HTML was a well formed 
>XML doc.  For example, I'd close my <img> tags like so:
>
><img src="foo.png" alt=""/>
>
>With this inside a <td> element XMLC was choosing to open the next <td> 
>instead of following the <img> tag with </td>.  Anyway, I fixed it by 
>writing non-well formed HTML.  Is there a way to get XMLC to do the right 
>thing when I write xHTML?
>   Thanks,
>    -M@
>
>_______________________________________________
>XMLC mailing list
>[email protected]
>http://www.enhydra.org/mailman/listinfo.cgi/xmlc