【发布时间】:2011-06-10 13:30:08
【问题描述】:
我想遍历 xml 文档中的所有 cd 元素。
<?xml version="1.0" encoding="iso-8859-1"?>
<ns0:catalog xmlns:ns0="http://Catalog.MP">
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
<cd>
在 XSLT 中,我会做类似的事情并使用 foreach 循环:
<xsl:output method="html" indent="yes"/>
<xsl:template match="/ns0:catalog">
<div class="catalog">
<xsl:for-each select="cd">
<div class="cd">
<div class="title">
<xsl:value-of select="title/text()" />
</div>
<div class="artist">
<xsl:value-of select="artist/text()" />
</div>
<div class="country">
<xsl:value-of select="country/text()" />
</div>
<div class="company">
<xsl:value-of select="company/text()" />
</div>
<div class="price">
<xsl:value-of select="price/text()" />
</div>
<div class="year">
<xsl:value-of select="year/text()" />
</div>
</div>
</xsl:for-each>
但是如何在 Biztalk 中做到这一点并使用等效的 functoid?
【问题讨论】: