--------------------------------
CRAWLING in MY skin
these WOUNDS they WILL not HEAL

FEAR is HOW i FALL
CONFUSING what IS real!

--------------------------------
Well Rasa,
Try this as per ur specs/reqs - This eventually turned the lights ON....
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template name="OrderItemNumberReplace">
<xsl:param name="outputString"/>
<xsl:param name="target"/>
<xsl:param name="replacement"/>
<xsl:choose>
<xsl:when test="contains($outputString,$target)">
<xsl:value-of select="concat(substring-before($outputString,$target),$replacement)"/>
<xsl:call-template name="OrderItemNumberReplace">
<xsl:with-param name="outputString" select="substring-after($outputString,$target)"/>
<xsl:with-param name="target" select="$target"/>
<xsl:with-param name="replacement" select="$replacement"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$outputString"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="//*/*/OrderItem/OrderItemNumber/text()">
<xsl:variable name="pos">
<xsl:number count="OrderItem" level="any" format="1"/>
</xsl:variable>
<xsl:call-template name="OrderItemNumberReplace">
<xsl:with-param name="outputString" select="//*/*/OrderItem/OrderItemNumber/text()"/>
<xsl:with-param name="target" select="'COUNTERREPLACE'"/>
<xsl:with-param name="replacement" select="$pos"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Ramesh
"Always Look For Something NEW"