Re: Localize help with doctype

Jacob Kjome <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Shawn,

The HTML DOM Level1 spec doesn't provide a way to store the doctype in the 
DOM.  As such, you have to add it yourself when serializing the DOM.  You 
can use XMLC's OutputOptions to do this.  Here is an example from the 
BConfig app...


             OutputOptions oo = 
DefaultDOMWriter.getDefaultOutputOptions(screen.dom.getOwnerDocument());

             oo.setOmitDocType(false);
             oo.setPublicId("-//W3C//DTD HTML 4.01 Transitional//EN");
             oo.setSystemId("http://www.w3.org/TR/html401/loose.dtd");

             new DefaultDOMWriter(oo).write(screen.dom, context.getResponse());

Jake

At 11:17 AM 11/10/2003 -0700, you wrote:
>I'm running into a problem with a DOCTYPE in my html files not making it 
>through to the final xmlc source. I'm using the localize Ant task which 
>extends the XMLC task but for the life of me I cannot find any 
>documentation on that thing (the xmlc taskdef) so I'm asking here.
>
>Basically, all my source HTML files look like this:
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
>"http://www.w3.org/TR/html4/loose.dtd">
>...
>Looking at the generated .java file from xmlc I don't see any reference
>to the doctype in there and it doesn't make it to the final rendered
>html from Barracuda either. Is there some argument to the localize task
>I'm missing? Here's how I call it:
>
>          <localize
>              markup="HTML"
>              tidy="true"
>              verbose="false"
>              force="${xmlc.force}"
>              srcdir="${src.dir}/${src.package.path}/xmlc"
>              packagedir="${src.package.path}/xmlc"
>              options="${xmlc_options.file}"
>              sourceout="${build.source.xmlc.dir}"
>              destdir="${build.classes.dir}"
>              includes="**/*.html"
>              excludes="**/old*/**"
>          />
>
>Any help would be appreciated.
>
>Thanks,
>-shawn
>
>_______________________________________________
>Barracuda mailing list
>[email protected]
>http://barracudamvc.org/lists/listinfo/barracuda
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.