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
On 9 Mar 2008, at 16:04, Rob Heittman wrote:
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,