Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

xslt 2 node text replace string

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

    <xsl:template match="p/text()[substring(., 1, 1) = ' '][preceding-sibling::node()[1][self::sub]]">
      <s />
      <xsl:value-of select="replace(., '^s+', '')" />
    </xsl:template>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #xslt #node #text #replace #string
ADD COMMENT
Topic
Name
7+8 =