Project

Profile

Help

How to connect?
Download (813 Bytes) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.8.0.12 / samples / styles / books-csv.xsl @ c74fd4aa

1
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
2
  
3
  <xsl:output method="text"/>
4
  
5
  <!-- This stylesheet outputs the book list as a CSV file -->
6
  
7
  <xsl:template match="BOOKLIST">
8
    <xsl:apply-templates select="BOOKS"/>
9
  </xsl:template>
10
  
11
  <xsl:template match="BOOKS">
12
    <xsl:text>Title,Author,Category,Stock-Value</xsl:text>
13
    <xsl:for-each select="ITEM">
14
      "<xsl:value-of select="TITLE"/>","<xsl:text/>
15
      <xsl:value-of select="AUTHOR"/>","<xsl:text/>
16
      <xsl:value-of select="@CAT"/>(<xsl:text/>
17
      <xsl:value-of select="if (id(@CAT)) then id(@CAT)/@DESC else 'Unclassified'"/>)","<xsl:text/>
18
      <xsl:value-of select="format-number(PRICE * QUANTITY,'######0.00')"/>"<xsl:text/>
19
    </xsl:for-each><xsl:text/>
20
  </xsl:template>
21
  
22
</xsl:stylesheet>	
(3-3/12)