You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Jason Dusek <ja...@uiowa.edu> on 2004/08/04 00:36:06 UTC

Outputting HTML elements to XHTML

Hi Everyone,

I would like to make up an HTML document using HTML*ElementImpl classes, and 
then I would like to serialize it as XHTML. Here is how I set up my serializer:

   OutputFormat output = new OutputFormat();
   output.setDoctype(OutputFormat.DTD.XHTMLPublicId,
     OutputFormat.DTD.XHTMLSystemId);
   output.setIndenting(true);
   XMLSerializer cereal = new XMLSerializer(System.out, output);

My document starts like this:

   HTMLDocumentImpl html = new HTMLDocumentImpl();
   html.setTitle("foo");
   HTMLDivElementImpl aDiv = new HTMLDivElementImpl(html, "div");
   html.getBody().appendChild(aDiv);

Now, if I just take some random XML document with 'div' and similar tags in it, 
and then output it, they come out lower case. But these HTML*ElementImpl classes 
always have uppercase tags. Is there an easy way to force them into lower case 
mode? Or do I have to replace them to get valid XHTML?

_jason

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org