在下面的代码片段中,我有 3 个 for-each,但在我看来,它们应该能够合并为一个。它按原样工作,但我想知道是否有人知道更优雅的编写方式?
<xsl:for-each select="/essentials/webservice">
<xsl:for-each select="document(@filename)/productSearchResponse/products/product">
<xsl:sort select="producingRegion" order="ascending"/>
<xsl:for-each select="producingRegion[not(preceding::producingRegion=.)]">
<xsl:value-of select="."/>
<br/>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>