doctype removed with transformation

Here should go questions about transforming XML with XSLT and FOP.
rorris
Posts: 6
Joined: Fri May 14, 2010 5:59 pm

doctype removed with transformation

Post by rorris »

I searched the archives and can't find an answer to this. When I run a simple transformation, I find that the doctype is getting removed from the output. Is there a way to fix this? I'm fairly new to XSLT, so apologies if this is obvious!

Before:
<!DOCTYPE book-part SYSTEM "book.dtd">

After:
gone
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: doctype removed with transformation

Post by george »

The DOCTYPE declarations (as it is the case also with entities) is not part of the data model and the XSLT code does not see that.

You can add a DOCTYPE declaration in the output using the xsl:output element and specifying the SYSTEM or also the PUBLIC identifiers with the doctype-system and doctype-public attributes.

Best Regards,
George
George Cristian Bina
rorris
Posts: 6
Joined: Fri May 14, 2010 5:59 pm

Re: doctype removed with transformation

Post by rorris »

Thank you very much for the explanation for this and my other similar post.
Post Reply