Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DOCTYPE declaration getting lost when using XSL

Tags:

xslt

The input to my XSL is an XHTML. After applying the XSL the DOCTYPE declaration that was present in the input XHTML gets lost in the output. Do i have an option to copy/retain the DOCTYPE declaration in the output using XSL. The XSL processor that i am using is SAXON.

like image 953
Rachel Avatar asked Apr 20 '10 14:04

Rachel


1 Answers

Add an output directive:

<xsl:output 
  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
/>

By the way, output directives stack - you can have as many of them as you want.

like image 98
Tomalak Avatar answered Nov 11 '22 06:11

Tomalak