I am using Notepad++ and attempting to replace all numeric strings within a specific tag (xxxxof my XML document with a new string which has been modified by a specific variable. Here's an example:


round(501234 * 0.9) = 451111


Is there a way to automatically find all numeric values within the start tag and do replace it by that same value multiplied by 0.9? I don't have to use Notepad++ if there's another tool that can do this.


  • use code markup for those tags of yours
    – Svish
    Aug 5, 2010 at 14:22

3 Answers 3


use xslt to modify a input.xml:


and you want to multiply the number between the start tags with 0.9, then create a "transformation file" (transform.xsl):

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:output method="xml" indent="yes"/>

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

<!-- transform what we are interested in -->
<xsl:template match="start">
    <foo><xsl:value-of select="number(.) * 0.9" /></foo>

and apply it like this:

% xsltproc transform.xsl input.xml

If You have minor knowledge of programing You can write your own very easily. You can use an XPathNavigator object to parse the XML with combination of C# or VB for task like that you should not spend more of half hour.

Begin Your own project with some of free versions of Visual Sudio and came to Stackoverflow.com whit your problems.


A very simple solution to this is to write a script (perhaps perl) to do a find and replace on your variable. this string matches everything between two tag variables ]>(.?). In perl you can just multiple the result of this regex with .9 and rewrite the answer. I deal with updating large xml files often and perl is by far the easiest solution to any of my problems


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .