Is it me? Or is it a bug? (or: DOCTYPE and xmlns)

15 views
Skip to first unread message

Meikel Brandmeyer

unread,
Oct 29, 2009, 5:31:47 AM10/29/09
to Enlive
Hi,

I have some trouble getting some template through the system. The
template looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

The result like this:

<!DOCTYPE "html" PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

Firefox barfs on the quotes around html and the missing xmlns
attribute on the html tag causes Firefox to display the xml tree and
not the rendered file.

I'm not very experienced in terms of web development, so any
corrections appreciated.

Sincerely
Meikel

Christophe Grand

unread,
Oct 29, 2009, 5:41:23 AM10/29/09
to enliv...@googlegroups.com
Hi Meikel,

On Thu, Oct 29, 2009 at 10:31 AM, Meikel Brandmeyer <m...@kotka.de> wrote:
>
> Hi,
>
> I have some trouble getting some template through the system. The
> template looks like this:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
>
> The result like this:
>
> <!DOCTYPE "html" PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html>
>
> Firefox barfs on the quotes around html and the missing xmlns
> attribute on the html tag causes Firefox to display the xml tree and
> not the rendered file.

The quotes around html are a plain bug. Thanks for the report.
The problem with the disappearing xmlns is related to TagSoup -- the
easier fix I have for it right now is that you add it back with a rule
in your template :-(
Concerning firefox displaying the xml tree, which Content-Type are you
sending in your response?

Christophe

Meikel Brandmeyer

unread,
Oct 29, 2009, 9:13:00 AM10/29/09
to Enlive
Hi,

On Oct 29, 10:41 am, Christophe Grand <christo...@cgrand.net> wrote:

> Concerning firefox displaying the xml tree, which Content-Type are you
> sending in your response?

I actually don't send a content type at the moment, because I load the
file from local disk w/o a server. The file is named .xhmtl. Firefox
believes the content to be 'application/xhtml+xml' according to page
info. Adding <?xml ...?> in front of the DOCTYPE has no influence. (Is
it needed?) BTW: Firefox also doesn't render SVG w/o xmlns="blabla/
svg".

Sincerely
Meikel

Christophe Grand

unread,
Oct 29, 2009, 3:35:56 PM10/29/09
to enliv...@googlegroups.com
Hi Meikel,

I pushed the fix for the doctype bug.

If your template is xhtml then you should try to replace html-resource
with xml-resource, thus xmlns attrs would be preserved.

Does this solve your problem?

Christophe
--
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)

Meikel Brandmeyer

unread,
Oct 30, 2009, 10:39:51 AM10/30/09
to Enlive
Hi Christophe,

On Oct 29, 8:35 pm, Christophe Grand <christo...@cgrand.net> wrote:

> If your template is xhtml then you should try to replace html-resource
> with xml-resource, thus xmlns attrs would be preserved.
>
> Does this solve your problem?

Yes. Indeed it does. Thanks to enlive and flying saucer I can now
generate our numerous periodic reports automatically. :)

Sincerely
Meikel

Christophe Grand

unread,
Oct 30, 2009, 10:49:34 AM10/30/09
to enliv...@googlegroups.com
On Fri, Oct 30, 2009 at 3:39 PM, Meikel Brandmeyer <m...@kotka.de> wrote:
> Yes. Indeed it does. Thanks to enlive and flying saucer I can now
> generate our numerous periodic reports automatically. :)

Nice! How good is flying saucer's pdf rendering?

Meikel Brandmeyer

unread,
Oct 30, 2009, 11:15:13 AM10/30/09
to Enlive
Hi,

On Oct 30, 3:49 pm, Christophe Grand <christo...@cgrand.net> wrote:

> Nice! How good is flying saucer's pdf rendering?

So far it looks ok. But I only rendered a few charts up to now. This
is all still work in progress. I'm struggling a little bit, because I
don't know how to best scale the chart graphics.... My preferred
solution would have been to use SVG for the charts, but the
combination of jfreecharts and batik doesn't play too well together.
At least in Firefox there was no satisfactory result. Maybe I should
try again with flying saucer.

And batik sucks in the world for dependencies. :(

Sincerely
Meikel
Reply all
Reply to author
Forward
0 new messages