This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Changing <b> to "["
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Changing <b> to "["
- From: Derek Ngok <derek dot ngok at objectvalley dot com>
- Date: Tue, 23 Jan 2001 09:46:17 +0800
- Organization: Object Valley (Asia Pacific) Ltd.
- References: <Pine.GSO.4.21.0101222018470.29431-100000@iapetus>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Change the second rule to:
<!-ELEMENTS B and I-->
<xsl:template match="b|i">
<xsl:text>[</xsl:text>
<xsl:apply-templates select="@*|node()"/>
<xsl:text>]</xsl:text>
</xsl:template>
Derek
Edierley Messias wrote:
> Hi People,
>
> I need to replace
> all <b> and <i> with "[" , and
> all </b> and </i> with "]"
> in a XML file.
>
> Everything was fine with the xsl below,
> but when I have a <b><i>text</i></b> sequence
> the result is:
>
> [<i>text</i>]
>
> And I need:
>
> [[text]]
>
> Do you have some ideia to look inside the match and apply the template
> again?
>
> Thank you very much.
>
> - - - - - - - - - - - - - - - - - - - - - - - - -
> XSL used:
>
> <!--MAIN TEMPLATE-->
> <xsl:template match="@*|node()">
> <xsl:copy>
> <xsl:apply-templates select="@*|node()"/>
> </xsl:copy>
> </xsl:template>
>
> <!-ELEMENTS B and I-->
> <xsl:template match="b|i">
> <xsl:text>[</xsl:text>
> <xsl:copy-of select="@*|node()"/>
> <xsl:text>]</xsl:text>
> </xsl:template>
> - - - - - - - - - - - - - - - - - - - - - - - - -
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list