Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在XSLT输出中定制XML声明标记?_Xml_Xslt - Fatal编程技术网

如何在XSLT输出中定制XML声明标记?

如何在XSLT输出中定制XML声明标记?,xml,xslt,Xml,Xslt,我的XSLT将XML转换为XML。它输出以下声明标记: <?xml version="1.0" encoding="utf-16"?> 但我需要它输出以下内容: <?xml version="1.0" encoding="utf-8" standalone="yes"?> 如何操作?在您使用的XSLT中,请在元素中添加以下属性 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/

我的XSLT将XML转换为XML。它输出以下声明标记:

<?xml version="1.0" encoding="utf-16"?>

但我需要它输出以下内容:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>


如何操作?

在您使用的XSLT中,请在
元素中添加以下属性

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    <xsl:output method="xml" standalone="yes"/>
    ......
</xsl:stylesheet>

......
这应该得到输出