Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


How to replace chars in a string

From: "Dave Rathnow" <drathnow@-----------.-----.--->
To: NULL
Date: 8/31/2005 1:42:00 PM
I'm a complete newbie to this "X" stuff so please bare with me.

I'm trying to replace all occurances of whitespaces in a string. I thought
I could use the fn:replace function but I'm having no luck.  When I try
this:

<xsl:template match="processedIoPoint">
    <xsl:variable name="bar" select="fn:replace(@name,' ', '_')"/>
    <channel type="{@type}" value="{scaledValue}" nameAlias="{$bar}"
uom="{@units}" qualData="{status}" nameChannel="{@channelName}"/>
</xsl:template>"

I get some error about there being no "replace" method that takes
([ExpressionContext,] #STRING, #STRING) as arguments.

I have two question:  Firt off, am I using the fn:replace function
incorrectly
and why is the argument "@name" being taken as an expression context and
not a string?

In any case, can someone tell me how I might solve the problem of replacing
the white spaces in my strings?

Thanks
Dave.




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent