Hi Jeroen,

Jeroen Kransen wrote:

> Hi, is there a way to let XStream add a DOCTYPE declaration to the
> generated XML?

XStream itself has no direct support, normally you would have to write the 
DOCTYPE declaration into the stream first.

> Basically, what I want is to convert HTML entities like $nbsp; to be
> converted to their XML counterparts. If there is a better approach to
> achieve this, I am open to it.

You can use more specialized writers like e.g. the Dom4JXmlWriter that uses 
a DOM4J-specific writer that supports a DOCTYPE. Either overwrite the 
createWriter method of the HierarchicalStreamDriver you're using or use 
XStream's marshal method to use a specific writer instance. The 
configuration and behavior of the underlaying writer depends then on the 
specific native package.

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to