у меня ниже XML
<?xml version="1.0" encoding="UTF-8"?>
<Wrapper>
<DynamicEnrichment>
<outpath>/opt/oracle/archive</outpath>
</DynamicEnrichment>
<ImagedDocuments sequence="11" beginTime="2018-12-03T16:03:11.7237883-06:00" endTime="2018-12-03T16:03:11.7237883-06:00">
<Document type="Secure - New Business Reg 60 Disclosure Form" path="\\prdausrvs01\Transfer\Onbase\OUT\EnterprisePrint\b726e5d73692463da29bd9183d6c3b6e_AV001220207.TIF" fileName="REG60DISC"/>
<Document type="Secure - New Business Reg 60 Disclosure Form1" path="\\prdausrvs01\Transfer\Onbase\OUT\EnterprisePrint\b726e5d73692463da29bd9183d6c3b6e_AV001220204.TIF" fileName="REG60DISC1"/>
</ImagedDocuments>
</Wrapper>
Что я хочу сделать, это заменить значение "\ prdausrvs01 \ Transfer \ Onbase \ OUT \ EnterprisePrint \" на "/ opt / oracle / archive /"
Я пробовал это с ниже xslt, но это выводит только новый элемент.Существующий атрибут не изменяется.
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="search" select="'EnterprisePrint\'"/>
<xsl:param name="replace" select="/Wrapper/DynamicEnrichment/outpath" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@path">
<xsl:variable name="str" select="substring-before(.,$search)" />
<xsl:attribute name="path">
<xsl:choose>
<xsl:when test="$str=''">
<xsl:value-of select="." />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($replace,substring-after(.,$search))" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:template match="/">
<xsl:element name='DynamicEnrichment'>
<xsl:attribute name='type'>
<xsl:text>TiffPathModifier</xsl:text>
</xsl:attribute>
<xsl:element name='PreditorEnvironment'>
<xsl:text>Changed TiffPaths if existed</xsl:text>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Любая помощь будет принята с благодарностью