Re: [xml] xml find and replace

Brilliant I've now got this 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">

<xsl:template match="node()|@*">
    <xsl:apply-templates select="node()|@*"/>

<xsl:template match="//control[name='DelaySeconds']/numeric/max/text()">

<xsl:template match="//control[name='DelaySeconds']/numeric/scalemax/text()">


And it seems to work, thanks for your help.

On Mon, Jul 16, 2012 at 1:22 PM, Noam Postavsky <npostavs users sourceforge net> wrote:
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[. =

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=""
to your root node,
then you can call str:replace.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]