Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Sequences (10/10) >

Instruction xsl:sequence

Behavior of the instruction xsl:sequence is very similar to xsl:copy-of. The difference, which is mostly hidden from the user is that xsl:sequence may return existing nodes and so makes transformation more straightforward and therefore efficient.
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="/aaa">
                  <aaa>
                        <v1>
                              <i>
                                    <xsl:sequence  select="bbb/@x"/>
                              </i>
                              <ii>
                                    <xsl:sequence  select="bbb"/>
                              </ii>
                              <iii>
                                    <xsl:sequence  select="1 to 4"/>
                              </iii>
                        </v1>
                        <v2>
                              <i>
                                    <xsl:copy-of  select="bbb/@x"/>
                              </i>
                              <ii>
                                    <xsl:copy-of  select="bbb"/>
                              </ii>
                              <iii>
                                    <xsl:copy-of  select="1 to 4"/>
                              </iii>
                        </v2>
                        <v3>
                              <i>
                                    <xsl:value-of  select="bbb/@x"/>
                              </i>
                              <ii>
                                    <xsl:value-of  select="bbb"/>
                              </ii>
                              <iii>
                                    <xsl:copy-of  select="1 to 4"/>
                              </iii>
                        </v3>
                  </aaa>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa>
            <bbb  x="1">A</bbb>
            <bbb  x="2">B</bbb>
      </aaa>
Output

      <aaa>
            <v1>
                  <i  x="2"/>
                  <ii>
                        <bbb  x="1">A</bbb>
                        <bbb  x="2">B</bbb>
                  </ii>
                  <iii>1 2 3 4</iii>
            </v1>
            <v2>
                  <i  x="2"/>
                  <ii>
                        <bbb  x="1">A</bbb>
                        <bbb  x="2">B</bbb>
                  </ii>
                  <iii>1 2 3 4</iii>
            </v2>
            <v3>
                  <i>1 2</i>
                  <ii>A B</ii>
                  <iii>1 2 3 4</iii>
            </v3>
      </aaa>


Previous chapter: Templates - basic usage
Next chapter: Sequence Combinations
Previous page: Several variables can be used is for ... in ... return instruction
Next page: - - -

Kevin Carr

Natural Skin Care European Soaps
Scented Body Care Shea Body Butter
city of stanton
search engine optimization orange county internetusers


Also, you will want to check out Stanton California so you can see what's up and they are part of Stanton City Hall as well.

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

This is the guy we need in government office. His name is Kevin Carr City Of Stanton Council Candidate and he is a great guy. and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks