给定一个源文档,像这样:将一系列元素转换为单个列表的XSLT?
<A>
<B>
<C>item1</C>
</B>
<B>
<C>item2</C>
</B>
<B>
<C>item3</C>
</B>
</A>
,我可以使用的产品是这样的什么XSLT:
<A>
<B>
<C>item1</C>
<C>item2</C>
<C>item3</C>
</B>
</A>
我已经尝试了片材...
<xsl:template match="B">
<xsl:choose>
<xsl:when test="count(preceding-sibling::B)=0">
<B>
<xsl:apply-templates select="./C"/>
<xsl:apply-templates select="following-sibling::B"/>
</B>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="./C"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
但我越来越...
<A>
<B>
<C>item1</C>
<C>item2</C>
<C>item3</C>
</B>
<C>item2</C>
<C>item3</C>
</A>
第二个问题:我很难调试XSLT。提示?
嘿,我这里有一个额外的模板......在上一篇文章中,你有一个:D – 2009-06-03 11:16:44