Jump to content

Brief Understanding


Guest samuelll
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...