xsl-list
[Top] [All Lists]

Re: Replacing strings in XSL

2005-03-19 02:11:40
When I see my below post in my browser (IE 6), I
cannot see the 3rd argument of translate function to
what I wrote. It appears as a blank(its a expected
browser function), and not the character reference I
wrote (160; preceded by &#). I guess you would also
see it as space .. I thought of pointing this to you.

You may look at "HTML source" of this post to see
exactly what I wrote!

I would also recommend this link..
http://www.dpawson.co.uk/xsl/sect2/nbsp.html
to read more about nbsp.

Regards,
Mukul

--- Mukul Gandhi <mukul_gandhi(_at_)yahoo(_dot_)com> wrote:
This can be achieved with the translate function..

For e.g. if the XML is -
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <MANUFACTURER>LG Electronics Inc</MANUFACTURER>
</root>

and XSL is -
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  
  <xsl:output method="html" indent="yes" />
  
  <xsl:template match="/root">  
    <p><xsl:value-of
select="translate(MANUFACTURER,'
', ' ')" /></p>
  </xsl:template>
  
</xsl:stylesheet>

The output of transform is -
<p>LG&nbsp;Electronics&nbsp;Inc</p>

Hope this is what you needed.

Regards,
Mukul



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more. 
http://info.mail.yahoo.com/mail_250

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--