I verified that every JAXP implementation I can get my hands on does
automatically invoke "html" serializer mode when the document's root node is
named "html".  This behavior isn't mentioned in the spec, but the JAXP JSRs
are in the category where the spec simply documents the RI, as opposed to
being an independent specification.

Personally I loathe this behavior, since it introduces whitespace and new
tags into the serialized version, causing this:  source DOM -> "html mode"
serialization -> structurally different DOM.  I don't think this is part of
the intent of DomRepresentation, it's an ugly side effect of the tools it
uses to do its work.

I've attached a bit longer patch that still sets the "xml" output property
-- because I think that is a gift to humanity -- but also exposes a
getTransformer() method so that programmers can extend DomRepresentation and
mutate the serialization properties themselves if desired ... e.g. put the
"html" mode back.  Ick.

On Sun, Mar 9, 2008 at 11:55 AM, Elliot Long <[EMAIL PROTECTED]> wrote:

> Fantastic! I can confirm that does indeed fix both issues even on SE5
> (who would have guessed? Well... you, i suppose!) Question now is if
> we can get the RESTlet code pached. I'm willing to bet this addition
> wouldn't cause issues on win or inux based systems, but i suppose
> testing would be necessary. Jerome?
>
> -Elliot
>
>

Attachment: DomRepresentation.java.patch
Description: Binary data

Reply via email to