Page 1 of 1
doctype removed with transformation
Posted: Thu Mar 24, 2011 2:09 am
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
Re: doctype removed with transformation
Posted: Thu Mar 24, 2011 6:50 am
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
Re: doctype removed with transformation
Posted: Thu Mar 24, 2011 4:55 pm
by rorris
Thank you very much for the explanation for this and my other similar post.