Hi again, before bringing up another issue let me first say that I enjoy using CASTOR.
Every time I find an issue I keep telling me it would have been much harder to code our project with an own XML-JAVA binding framework - we would have surely ended up with more bugs and less features than CASTOR :) Having said that here is my issue: I can't seem to get my Marshaller instance to honour the setMarshalAsDocument() setting. I have tried with both 0.9.3.9 and today's (jan-25) snapshot. I always get the XML declaration at the start. Somehow related to this I never get a DOCTYPE in my marshalled XML files. The API documentation says (Marshaller.setMarshalAsDocument): "Sets whether or not to marshal as a document which includes the XML declaration, and if necessary the DOCTYPE declaration" So when is it "necessary" to have a DOCTYPE ? I tried to explicitly set the root element (Marshaller.setRootElement()) which didn't change the behaviour. What did I miss ? Thanks for your help, Laslo PS: I attached an archive containing the schema, JAVA test class and ANT script for reproducing the issue. Only adjust path to castor.jar and xerces.jar in "init" target and run "ant asdoc" and see src/asdoc/out1.xml and .../out2.xml . <<asdoc_test.zip>>
asdoc_test.zip
Description: Binary data