Guest samuelll Posted July 27, 2009 Share Posted July 27, 2009 Just started with XLS and I have this code, which I think suppose to copy every node to the output file. But I am really not sure... <!-- Copies everything? But it doesn't?? --> <!-- Matches any element node --><xsl:template match="*"> <xsl:copy> <!-- Matches any attribute node --> <xsl:for-each select="@*"> <xsl:copy/> </xsl:for-each> <xsl:apply-templates/> </xsl:copy></xsl:template> Link to comment Share on other sites More sharing options...
boen_robot Posted July 27, 2009 Share Posted July 27, 2009 Well... if that's the only template you have... it should... if it doesn't, try to add <xsl:template match="/"><xsl:apply-templates/></xsl:template> If it's not the only template, keep in mind that more specific teplates will override this template. For example, if you also have: <xsl:template match="b"><strong><xsl:apply-templates/></strong></xsl:template> you'll copy all nodes, expect "b" elements, which would instead be turned into "strong" elements. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.