Re: [xml] xml find and replace
- From: Noam Postavsky <npostavs users sourceforge net>
- To: stuart shepherd <jonny wark googlemail com>
- Cc: xml gnome org
- Subject: Re: [xml] xml find and replace
- Date: Mon, 16 Jul 2012 08:22:45 -0400
On Mon, Jul 16, 2012 at 6:09 AM, stuart shepherd
<jonny wark googlemail com> wrote:
<xsl:template match="//control[name='DelaySeconds']/numeric/max">
<xsl:element name="{name(.)}">
<xsl:value-of select="translate(string(.), '110', '5')" />
</xsl:element>
</xsl:template>
I think you could just do
<xsl:template match="//control[name='DelaySeconds']/numeric/max[. =
110]/text()">
<xsl:text>5</xsl:text>
</xsl:template>
Actually I guess you don't care about the original value so you don't
even need the [. = 110] part.
I've tried using replace instead of translate but I get the error message
xmlXPathCompOpEval: function replace not found
XPath error : Unregistered function
replace is an Exslt function, add xmlns:str="http://exslt.org/strings"
to your root node,
then you can call str:replace.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]