A list of sequence : subsequence « XSLT stylesheet « XML






A list of sequence


File: Data.xml


File: Transform.xslt

<?xml version="1.0"?>
<xsl:stylesheet version="2.0" 
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="text"/>

  <xsl:template match="/">
    <xsl:variable name="cities" as="xs:string*">
      <xsl:sequence select="addressbook/address/city"/>
      <xsl:sequence select="('A', 'B', 'C')"/>
      <xsl:sequence select="('D', 'E', 'F')"/>
    </xsl:variable>
    <xsl:text>Our customers live in these cities:&#xA;&#xA;</xsl:text>
    <xsl:value-of select="$cities" separator="&#xA;"/>
  </xsl:template>

</xsl:stylesheet>

Output:

Our customers live in these cities:

A
B
C
D
E
F

 








Related examples in the same category

1.Define sequence
2.subsequence() function