Xml 如何在xsl:comment中获取动态值

Xml 如何在xsl:comment中获取动态值,xml,xslt-1.0,Xml,Xslt 1.0,下面的代码不会像在cdata中那样加载$URL\u前缀的动态值。 请让我知道如何在注释中获取动态值 <xsl:comment><![CDATA[[if gte IE 9]> <link href="$URL_PREFIX/Static/resources/common/css/redesign/new-ie.css" rel="stylesheet" type="text/css" /> <![endif]]]&g

下面的代码不会像在cdata中那样加载$URL\u前缀的动态值。 请让我知道如何在注释中获取动态值

    <xsl:comment><![CDATA[[if gte IE 9]>    
        <link href="$URL_PREFIX/Static/resources/common/css/redesign/new-ie.css" rel="stylesheet" type="text/css" />
    <![endif]]]></xsl:comment>


我想要$URL\u前缀的值。

我想你需要像这样分解你的
CDATA

    <xsl:comment><![CDATA[[if gte IE 9]>   
    <link href="]]><xsl:value-of select="$URL_PREFIX"/><![CDATA[/Static/resources/common/css/redesign/new-ie.css" rel="stylesheet" type="text/css" />
<![endif]]]></xsl:comment>

完整示例

XSLT1.0(适用于任何XML输入)


输出

<!--[if gte IE 9]>   
        <link href="http://foo.com/Static/resources/common/css/redesign/new-ie.css" rel="stylesheet" type="text/css" />
    <![endif]-->

您试图生成什么输出?从什么输入?
<!--[if gte IE 9]>   
        <link href="http://foo.com/Static/resources/common/css/redesign/new-ie.css" rel="stylesheet" type="text/css" />
    <![endif]-->