Using javax.xml... I lose my <!DOCTYPE
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Skelton
Posted On:   Monday, September 17, 2001 08:46 AM




		.
		



As far as I can tell, this is as per spec, but I can't see a way of saying 'I want to keep the DOCTYPE'.



Can anyone shed any light?



Many thanks in advance for any reponses.



John Skelton

Re: Using javax.xml... I lose my <!DOCTYPE

Posted By:   John_Skelton  
Posted On:   Tuesday, September 18, 2001 02:38 AM

OK, I've got it.



Even though this.document and domSource 'know' about the DOCTYPE element, the transformer doesn't include it in the output UNLESS you specifically add it as a property of the transformer using something along the lines of...



transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, document.getDoctype().getSystemId());


John
About | Sitemap | Contact