Here's a clue to it ... I'm digging further.

Restlet does a pretty standard JAXP (TRAX) API transform to serialize the
output:

                Transformer transformer = TransformerFactory.newInstance()
                        .newTransformer();

                if (getDocument().getDoctype() != null) {
                    transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,
                            getDocument().getDoctype().getSystemId());
                    transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC,
                            getDocument().getDoctype().getPublicId());
                }

                transformer.transform(new DOMSource(getDocument()),
                        new StreamResult(outputStream));

When I apply this transform to the W3C document produced with your code and
JDOM:

final DOMOutputter out = new DOMOutputter();
org.w3c.dom.Document d = out.output(doc);

... the error occurs -- I get the malformed doctype on standard out.  I
reproduced this using a standalone Java application and no Restlet plumbing
at all.  I'm a little shocked to see this behavior occurring in a core api
like TRAX, but there it is.  As I said, more diligence to follow.

BTW, MediaType.APPLICATION_XHTML_XML is cleared of wrongdoing.

- Rob


On Sat, Mar 8, 2008 at 5:06 PM, Rob Heittman <[EMAIL PROTECTED]>
wrote:

>
> I'll try out your code a little later tonight, if no one beats me to an
> answer.  The pieces you use that I don't are JDOM and the
> APPLICATION_XHTML_XML MediaType, so there may be some surprises lurking for
> me.
>
> - R
>
>

Reply via email to