Jump to content

Brief Understanding


Guest samuelll

Recommended Posts

Guest samuelll

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...