RE: Tab delimited file

Subject: RE: Tab delimited file
From: "DuCharme, Robert" <Robert.DuCharme@xxxxxxxxxx>
Date: Wed, 17 May 2000 19:33:21 -0400
>Given the following XML
>
><?xml version="1.0"?>
><results>
><assetType>Bond</assetType>
>...
><assetType>Warrant</assetType>
></results>
>
>I want to output a tab delimited file like
>
>Asset List
>
>#	Name
>1	Bond
>2	Bond

I thought that since the stylesheet uses a tab twice, it was worth defining
it as an entity so that it would look cleaner in the code:

<?xml version="1.0"?>
<!DOCTYPE stylesheet [  
<!ENTITY tab "<xsl:text>&#9;</xsl:text>">
]>
  <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

    <xsl:template match="assetType">
      <xsl:number/>&tab;<xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="results">
Asset List

#&tab;Name
    <xsl:apply-templates/>
  </xsl:template>

</xsl:stylesheet>


Bob DuCharme       www.snee.com/bob       <bob@  
snee.com>  see www.snee.com/bob/xmlann for "XML:
The Annotated Specification" from Prentice Hall.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread