This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Tab delimited file
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Tab delimited file
- From: "DuCharme, Robert" <Robert dot DuCharme at moodys dot com>
- Date: Wed, 17 May 2000 19:33:21 -0400
- Reply-To: xsl-list at mulberrytech dot com
>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>	</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