You'll need to write the DOCTYPE yourself as such:
writer.write("<?xml version=\"1.0\"?>\n");
writer.write("<!DOCTYPE ...>\n");
Marshaller m = new Marshaller(writer);
m.setMarshalAsDocument(false); // <-- prevent Castor from writing <?xml
version="1.0"?>
m.marshal(myObj);
--Keith
xml jdbc wrote:
>
> Hi all,
>
> I am using CASTOR as my data binding framework, i have existing java
> classes so did not use the code generation capablities of CASTOR. I
> need to marshall an XML document and add a header to specify DTD
> location.
>
> I know we use "setSchemaLocation(java.lang.String schemaLocation) " to
> specify a schema locatiion, how to specify DTD documents like
> (<!DOCTYPE case SYSTEM "case.dtd">). Also is it possible to use DTD to
> validate the document instead of an schema can some body share their
> exoeriences please.
>
> Thanks
>
> ----------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev