Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Elements and attributes (1/7) >

Literal result elements

The title of this page sounds formidable but under this unfortunate term is hidden a very simple feature which is used in almost every stylesheet.

Literal results elements are all elements in the stylesheet which do not belong to the XSLT namespace (and are not extension instructions). These elements are copied together with their attributes to the output and we are using this feature from the beginning of this tutorial.

In this example the elements xxx, yyy, and zzz are literal result elements while e.g. xsl:template or xsl:value-of are not.

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="/*">
                  <xxx>
                        <yyy  r="a"
                                    s="b">
                              <zzz>
                                    <xsl:value-of  select="."/>
                              </zzz>
                        </yyy>
                  </xxx>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa>111</aaa>
Output

      <xxx>
            <yyy  r="a"
                        s="b">
                  <zzz>111</zzz>
            </yyy>
      </xxx>


Previous chapter: Conditional Expressions
Next chapter: Groups
Previous page: - - -
Next page: Usage of XPath in the attribute values - curly brackets {}

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