如何从XSLT xsl:for-each循环生成XML节点?
<xsl:for-each select="//aaa/bbb">
<section name="HOW CAN I INSERT THERE //aaa/bbb//ccc?">
<xsl:for-each select="//aaa/bbb[xxx=101]">
<p>
<xsl:value-of select="ParameterName"/>
</p>
</xsl:for-each>
</section>
</xsl:for-each>
答案 0 :(得分:1)
你的问题并不完全清楚,但你的意思是:
<xsl:for-each select="//aaa/bbb">
<section>
<xsl:attribute name="name">
<xsl:value-of select=".//ccc"/>
</xsl:attribute>
<xsl:for-each select="//aaa/bbb[UtilityDefinitionsID=101]">
<p>
<xsl:value-of select="ParameterName"/>
</p>
</xsl:for-each>
</section>
</xsl:for-each>
(未经测试,因为没有您尝试处理的xml的示例)
答案 1 :(得分:1)
<section>
<xsl:attribute name="name">
<xsl:value-of select="ccc"/>
</xsl:attribute>
<xsl:for-each select="//aaa/bbb[UtilityDefinitionsID=101]">
<p>
<xsl:value-of select="ParameterName"/>
</p>
</xsl:for-each>
</section>