Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.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

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 xsl:for-each只执行第一行_Xml_Xslt - Fatal编程技术网

Xml XSLT xsl:for-each只执行第一行

Xml XSLT xsl:for-each只执行第一行,xml,xslt,Xml,Xslt,我有一些XML,我将其提供给XSLT样式表来进行一些转换,但不知何故,xsl:for-each仅通过第一个节点循环 我希望它在所有节点之间循环并转换它们,但不知怎么的,它只在第一个值之间循环,不确定我在这里做错了什么 这是我的XML: <?xml version="1.0"?> <email> <uid>66</uid> <subject>You have been added to a Priooo project&l

我有一些XML,我将其提供给XSLT样式表来进行一些转换,但不知何故,xsl:for-each仅通过第一个节点循环

我希望它在所有节点之间循环并转换它们,但不知怎么的,它只在第一个值之间循环,不确定我在这里做错了什么

这是我的XML:

<?xml version="1.0"?>
<email>
    <uid>66</uid>
    <subject>You have been added to a Priooo project</subject>
    <message/>
    <arguments>
        <argument>
            <name>
                -url-
            </name>
            <value>
                http://localhost/iaf4asap/#/resetpassword/c0a82001--6b0373de_15eb8270a5e_-7fea</value>
            </argument>
            <argument>
                <name>
                    -inviteBy-
                </name>
                <value>Laurens Makel</value>
            </argument>
            <argument>
                <name>
                    -project-
                </name>
                <value>junkspam0003@outlook.com</value>
            </argument>
        </arguments>
    <templateId>
        c02f1e50-d569-41d9-87ec-933cded8a330
    </templateId>
</email>

66
您已被添加到Priooo项目中
-网址-
http://localhost/iaf4asap/#/resetpassword/c0a82001--6b0373de_15eb8270a5e_7;-FEA
-邀请者-
劳伦斯·马克尔
-计划-
junkspam0003@outlook.com
c02f1e50-d569-41d9-87ec-933cded8a330
这是我的XSLT:

    <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output omit-xml-declaration="yes" method="xml"/>


    <xsl:template match="/email">
    <email>
            <uniqueArguments>
                 <xsl:for-each select="arguments">
                    <uniqueArgument>
                        <name><xsl:value-of select="argument/name"/></name>
                        <value><xsl:value-of select="argument/value"/></value>
                    </uniqueArgument>
                 </xsl:for-each>
            </uniqueArguments>
            <templateId>
                <xsl:value-of select="templateId"></xsl:value-of>
            </templateId>
        </email>
    </xsl:template>

</xsl:stylesheet>       

这将为我提供以下输出..:

     <?xml version="1.0"?>
<email>
    <uniqueArguments>
        <uniqueArgument>
            <name>
                -url-
            </name>
            <value>
                http://localhost/iaf4asap/#/resetpassword/c0a82001--6b0373de_15eb8270a5e_-7fea</value>
            </uniqueArgument>
        </uniqueArguments>
    <templateId>
        c02f1e50-d569-41d9-87ec-933cded8a330
    </templateId>
</email>

-网址-
http://localhost/iaf4asap/#/resetpassword/c0a82001--6b0373de_15eb8270a5e_7;-FEA
c02f1e50-d569-41d9-87ec-933cded8a330

您只在一个节点上循环
参数
,xsl:对于每个所需的XPath,结果中有许多节点,请使用:

<xsl:for-each select="arguments/argument">

您只在一个节点上循环
参数
,xsl:对于每个所需的XPath,结果中有许多节点,请使用:

<xsl:for-each select="arguments/argument">