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
Xml 如何在XSLT中连接相同的属性值_Xml_Xslt_Xpath - Fatal编程技术网

Xml 如何在XSLT中连接相同的属性值

Xml 如何在XSLT中连接相同的属性值,xml,xslt,xpath,Xml,Xslt,Xpath,我希望连接元素的所有A02属性值 预期结果:在XSLT 2.0中,HiThisisconcat可以使用: 根据要求。在XSLT 2.0中,您可以使用: 根据要求。作为字符串联接的替代方法,您可以使用 如果存在分隔符属性,则 此属性用于分隔结果中的相邻项 序列 作为字符串联接的替代方法,您可以使用 如果存在分隔符属性,则 此属性用于分隔结果中的相邻项 序列 在XSLT1.0中 如果没有与这些属性匹配的模板,也可以使用: <xsl:for-each select="//N/@A02">

我希望连接元素的所有A02属性值

预期结果:在XSLT 2.0中,HiThisisconcat可以使用:

根据要求。

在XSLT 2.0中,您可以使用:

根据要求。

作为字符串联接的替代方法,您可以使用

如果存在分隔符属性,则 此属性用于分隔结果中的相邻项 序列

作为字符串联接的替代方法,您可以使用

如果存在分隔符属性,则 此属性用于分隔结果中的相邻项 序列

在XSLT1.0中

如果没有与这些属性匹配的模板,也可以使用:

<xsl:for-each select="//N/@A02">
    <xsl:value-of select="."/>
</xsl:for-each>
为确保没有其他模板匹配,您可以使用以下模式创建模板:

<xsl:apply-templates select="//N/@A02"/>
在XSLT1.0中

如果没有与这些属性匹配的模板,也可以使用:

<xsl:for-each select="//N/@A02">
    <xsl:value-of select="."/>
</xsl:for-each>
为确保没有其他模板匹配,您可以使用以下模式创建模板:

<xsl:apply-templates select="//N/@A02"/>

抱歉,在我的机器上它只支持XSLT 1.0抱歉,在我的机器上它只支持XSLT 1.0
<xsl:apply-templates select="//N/@A02"/>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template match="N/@A02" mode="concat">
    <xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="/">
    <xsl:apply-templates select="//N/@A02" mode="concat"/>   
  </xsl:template>
</xsl:stylesheet>