here is the XML I'm treating:
<dsQueryResponse>
<Rows>
<Row ID="14"></Row>
</Rows>
</dsQueryResponse>
This XSL is working:
<xsl:template match="Row">
<xsl:value-of select="@ID"/>
</xsl:template>
But not this one:
<xsl:template match="/">
开发者_如何学Go <xsl:call-template name="CustomTemplate"/>
</xsl:template>
<xsl:template name="CustomTemplate">
<xsl:template match="Row">
<xsl:value-of select="@ID"/>
</xsl:template>
</xsl:template>
I need to fit with the second structure, making a call-template, does anyone understand what has to be changed in the second XSL ?
I don't think you can nest templates like that. What you can do is the following:
<xsl:template match="/">
<xsl:call-template name="CustomTemplate"/>
</xsl:template>
<xsl:template name="CustomTemplate" match="Row">
<!-- format rows here -->
</xsl:template>
精彩评论