Condition in XSLT 1.0?

前端 未结 3 1496
半阙折子戏
半阙折子戏 2021-01-19 08:14

I have an XSLT 1.0 (2.0 is not an option) stylesheet which produces XHTML. It can, depending on a parameter, produce a full XHTML validable document or just a

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-19 08:26

    In XSLT the value of omit-xml-declaration must be either yes or no, you can't use Attribute Value Templates there. This applies to both 1.0 and 2.0.

    The doctype attributes can use AVTs, but the problem is that you cannot omit the attribute, you can only output an empty attribute and this leads to output that has empty doctype strings.

    Sorry, can't be done with XSLT. You can either use two different stylesheets, or set the output parameters in the code that calls the XSLT processor.

提交回复
热议问题