Re: [xsl] Passing xml nodes to a function

Subject: Re: [xsl] Passing xml nodes to a function
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 10 Aug 2006 15:47:34 +0100
   		    <xsl:apply-templates select=".//response/*/response/*" mode="table"/>

> What I am getting at the moment is the following:-
your posted xml didn't have response as a grandchild of response so I'll
have to guess that's OK, * selects client and then


   		   <xsl:template match="*" mode="table">
		     <tr>
		       <td><xsl:value-of select="name()"/></td>
		       <xsl:if test="not(*)"><td><xsl:value-of select="."/></td></xsl:if>
		     </tr>
<xsl:apply-templates mode="table" select="*"/>
		  </xsl:template>
		

should put all the data in a table, but i expect that the output you are
seeing is from the default template (ie, it's the same as as the output
from a stylesheet that has no templates). Without seeing what your
input looks like I can't suggest whet match pattern should be on your
initial template.
If the xml posted is the complete xml document, then you want something
like
<xsl:template match="/response"
<table>
    		    <xsl:apply-templates select="*" mode="table"/>
</table>
</xsl:template>

David

Current Thread