Web Analytics Made Easy -
StatCounter whats the difference between these statements - CodingForum

Announcement

Collapse
No announcement yet.

whats the difference between these statements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • whats the difference between these statements

    Can some one explain the difference between these:

    xsl:call-template
    xsl:apply-template
    <xsl:include href="Templates.xsl"/>

    Is there a good website which explains these and other xsl in detail? I checked the www.w3schools.com and they only explain it very lightly.

  • #2
    xsl:call-template is used when you want to specifically call a NAMED template, think of it almost as calling a function of your xsl

    Code:
    <xsl:template name="CreateHeader">
      <head>
       <blah....../>
      </head>
    </xsl:template>
    xsl:apply-templates is more generic in the sense that it now opens up global access to your stylesheet to handle the elements by each of there responsible template match(es)

    Code:
    <xsl:template match="a">
      <a href="{@src}"><xsl:value-of select="text()"/></a>
    </xsl:template>

    Comment

    Working...
    X