Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Implicit behaviour (1/10) >

xsl:apply-templates without select attribute

If xsl:apply-templates element without select attribute is used, the value of implicit select is set to "node()". It means that all children nodes are selected.

XSLT

      <xsl:stylesheet
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  version="2.0">
            <xsl:output  method="xml"
                        indent="yes"
                        omit-xml-declaration="yes"/>

            <xsl:template  match="/*">
                  <xsl:apply-templates/>
            </xsl:template>

            <xsl:template  match="text()">
                  <text>
                        <xsl:value-of  select="normalize-space(.)"/>
                  </text>
            </xsl:template>

            <xsl:template  match="comment()">
                  <comment>
                        <xsl:value-of  select="normalize-space(.)"/>
                  </comment>
            </xsl:template>

            <xsl:template  match="@*">
                  <attribute>
                        <xsl:value-of  select="."/>
                  </attribute>
            </xsl:template>

            <xsl:template  match="*">
                  <element>
                        <xsl:value-of  select="name()"/>
                  </element>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa  a="1"> BBB
            <ccc/> DDD <!-- comment -->
      </aaa>
Output

      <text>BBB</text>
      <element>ccc</element>
      <text>DDD</text>
      <comment>comment</comment>
      <text/>


Previous chapter: Context
Next chapter: Arithmetics
Previous page: - - -
Next page: xsl:apply-templates without select attribute and position

Kevin Carr in Stanton

Natural Skin Care and European Soaps
TickTalk 5
city of stanton
internetusers


You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks ing suit and swim trunks