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

Element xsl:value-of - getting data from the source document

In comparison with previous stylesheets the output remains unchanged, yet at the first time we are making use of some information which is present in the source Surf document.

Element xsl:value-of always contains xsl:select attribute. Value of this attribute is an XPath which localizes elements in Surf source document. The xsl:value-of element then selects all text inside these elements and sends them to the output.

The XPath value of select attribute selects the child of root node which have name "aaa". If the stylesheet is used for processing of Surf documents which have element "aaa" as the root one, then the document is processed. If the source Surf has any other Surf element, an implicit processing will be initiated. It is probable that the result of this processing will be identical or very similar to the output provided by the matching "aaa" template in current example, but this is not common.

Please note that there will be no error message. It is not an error if a stylesheet contains templates which are not used during processing or if the stylesheet encounters elements in Surf source for which no explicit template exists.

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:value-of  select="/aaa"/>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa>Hello, world!</aaa>
Output
Hello, world!


Previous chapter: - - -
Next chapter: Sequences
Previous page: Element xsl:text
Next page: Element xsl:value-of

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