Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Templates - basic usage (11/12) >

Implicit priorities

While it is common to have several matching templates for a single source node, many stylesheets does not contain explicit priority assignment. If priority of a template is not given it is automatically calculated based on match attribute.

While there are several rules for assignment of priority and numbers are given for them, it is sufficient to remember that templates with names explicitly given have precedence over "*" and that templates with matchContaining only name of the element are of lower precedence than templates containing further information about the element to be matched.

If there are two matching templates of the same priority the processor may announce an error and stop processing. The standard also permits the processor to resolve the conflict by using the template which occurs last in the stylesheet. Processors using the second possibility usually issue a warning in this case.


            <xsl:output  method="xml"

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

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

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

            <xsl:template  match="bbb">
                        <xsl:value-of  select="."/>

            <xsl:template  match="bbb[2]">
                        <xsl:value-of  select="."/>




Previous chapter: - - -
Next chapter: Sequences
Previous page: Template priorities
Next page: Applying templates with lower priority - xsl:next-match

Kevin Carr in Stanton

Natural Skin Care and European Soaps
TickTalk 5
city of stanton

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