This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Convert XML elements with extended attributes into CSV
- To: Xiaocun Xu <xiaocunxu at yahoo dot com>
- Subject: Re: [xsl] Convert XML elements with extended attributes into CSV
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Mon, 28 May 2001 21:16:22 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <20010528193403.63050.qmail@web11106.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Xiaocun,
> Thanks Jeni. The template you provided to replace " with "" worked
> great. The flexibility that the template can either use
> apply-templates or call-template proved to be real useful. Since I
> was only applying it to the attributes, I followed your instruction
> to call it by name like following:
>
> <xsl:call-template name="escape-CSV">
> <xsl:with-param name="string" select="@Description" />
> </xsl:call-template>
>
> and it worked prefectly.
No problems, but you can apply templates in 'escape-CSV' mode to any
kind of node, attributes included, so with the template I provided,
you could do:
<xsl:apply-templates select="@Description" mode="escape-CSV" />
with exactly the same effect.
My comment about calling templates instead was if you need to
substitute strings in, say, the first 20 characters of a string, or
the normalised version of it or something, e.g.:
<xsl:call-template name="escape-CSV">
<xsl:with-param name="string"
select="substring(@Description, 1, 20)" />
</xsl:call-template>
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list