开发者

DOCTYPE declaration getting lost when using XSL

开发者 https://www.devze.com 2022-12-27 07:27 出处:网络
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

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开发者_如何学C processor that i am using is SAXON.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号