[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Replacing the space character with another charact

Subject: RE: Replacing the space character with another character
From: "Mark Peters" <flickrmeister@xxxxxxxxx>
Date: Sun, 13 May 2007 22:50:56 -0400
 RE: Replacing the space character with another charact
Thank you both. I'm using Xalan. Although I tried replacing
translate(.,'&#x20;','&#x26;') with translate(.,' ','*'), my indexterm
spaces still disappear -- they don't get replaced with either an ampersand
or an asterisk, as specified.

Maybe I need to replace my processor.

Mark

On 5/13/07, mozer <xmlizer@xxxxxxxxx> wrote:
>
> &#x26; --> &
> &#x2A; --> *
>
> Xmlizer
>
> On 5/13/07, Mark Peters <flickrmeister@xxxxxxxxx> wrote:
> > Hi,
> >
> > I'm trying to replace the space character with another character (I've
> > chosen the asterisk, but it could be anything) in a specific element's
> text
> > contents. I've read the Replace and String Replace pages on Dave
> Pawson's
> > site, and have read about the translate XPath function, but am still
> coming
> > up empty (literally!).
> >
> >
> > In my input XML, I have a number of <indexterm> elements such as the
> > following:
> >
> >  <indexterm>Greek History</indexterm>
> >
> >
> > I'd like to replace the space character as follows:
> >
> >  <indexterm>Greek*History</indexterm>
> >
> >
> > My stylesheet contains the following template:
> >
> >  <xsl:template match="indexterm">
> >     <indexterm>
> >        <xsl:value-of select="translate(.,'&#x20;','&#x26;')"/>
> >     </indexterm>
> >  </xsl:template>
> >
> >
> > For some reason, the stylesheet removes the spaces, rather than
> replacing
> > them with the asterisk:
> >
> >  <indexterm>GreekHistory</indexterm>
> >
> >
> > What am I doing wrong?
> >
> > Thanks,
> > Mark

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.