This actually might be something Restlet can workaround.  Setting the
following property on the Transformer fixes both issues for me.

        transformer.setOutputProperty(OutputKeys.METHOD, "xml");

It appears that the default for the Transformer, at least on this platform
and/or when the root tag of the document is "html", is to use HTML
rendering.  That pretty-prints the output, inserts the META tag, etc.  And
triggers the bug.  I think this patch, forcing "xml" style handling of
DomRepresentations, is safe.  Jerome, Thierry, thoughts?

Index: DomRepresentation.java
===================================================================
--- DomRepresentation.java    (revision 2761)
+++ DomRepresentation.java    (working copy)
@@ -182,6 +182,7 @@
             if (getDocument() != null) {
                 Transformer transformer = TransformerFactory.newInstance()
                         .newTransformer();
+                transformer.setOutputProperty(OutputKeys.METHOD, "xml");

                 if (getDocument().getDoctype() != null) {
                     transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM
,

Reply via email to