<xsl:template match="/set">
<xsl:value-of select="name">  <xsl:apply-templates select="descriptiom/position()=position()"/>
<xsl:apply-templates select="code/position()=position()"/>
</xsl:template><xsl:template match="description">
   <xsl:value-of select="."/>
</xsl:template><xsl:template match="code">
   <xsl:value-of select="."/>
</xsl:template>
其实,这样定义xml文件就省事多了
<set>
     <setentry>
           <name/>
           <description/>
           <code/>
   </setentry>
</set>
当然,如果没有权限修改xml文件的定义就没办法了,呵呵

解决方案 »

  1.   

    sorry,上面的验证了一下,不对,下面帖一个验证过的
    <xsl:template match="/set">
    <xsl:for-each select="name">
    <xsl:value-of select="."/> | 
    <xsl:variable name="pos" select="position()"/>
    <xsl:apply-templates select="/set/description[position()=$pos]"/> | 
    <xsl:apply-templates select="/set/code[position()=$pos]"/><br/>
    </xsl:for-each>
    </xsl:template><xsl:template match="//description">
       <xsl:value-of select="."/>
    </xsl:template><xsl:template match="//code">
       <xsl:value-of select="."/>
    </xsl:template>