Subject: Re: Convert XML elements with extended attributes into CSV
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Mon, 28 May 2001 12:34:03 -0700 (PDT)
|
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.
Much appreciated,
Xiaocun
> The translate() function only deals with
> single-character-to-single-character replacement.
> To get what you
> need, you need to use a recursive template to work
> through the string,
> replacing all "s with ""s:
>
> <xsl:template match="node()" mode="escape-CSV"
> name="escape-CSV">
<!-- skipped: code to replace " with "" -->
> </xsl:template>
>
> To use this template, you need to apply templates in
> escape-CSV mode
> to the node whose value you want to escape.
>
> Or if you only want to apply it to a partial node
> value, then you can
> call it by name, setting the $string parameter.
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- <xsl:include href="cant_be_found_on_linux.xsl"/>???, (continued)
- Robert Koberg - Sun, 27 May 2001 12:45:16 -0400 (EDT)
- Xiaocun Xu - Sat, 26 May 2001 21:52:34 -0400 (EDT)
- Jeni Tennison - Sun, 27 May 2001 05:34:22 -0400 (EDT)
- Xiaocun Xu - Mon, 28 May 2001 00:18:48 -0400 (EDT)
- Xiaocun Xu - Mon, 28 May 2001 15:32:01 -0400 (EDT) <=
- Jeni Tennison - Mon, 28 May 2001 18:08:04 -0400 (EDT)
- Xiaocun Xu - Tue, 29 May 2001 11:04:19 -0400 (EDT)
- Jeni Tennison - Wed, 30 May 2001 06:33:49 -0400 (EDT)
- Xiaocun Xu - Wed, 30 May 2001 16:50:32 -0400 (EDT)
|
|