In my xml there are such xml tags:
<field><</field>
I need to replace the "<" character with blank. I tried this statement but it prompts an error.
<xsl:value-of select="replace(.//field, '\<', '')"/>
Error. Unable to generate the XML document using the provided XML/XSL input. Errors were reported during stylesheet compilation
How can I do it?
It is not clear whether you use an XSLT 1 processor where the XPath 2 function replace
is simply not supported or whether the error is from the attempt to use the backslash or the attempt to call the replace
function on several field
element, in any case it should suffice to use
<xsl:template match="field">
<xsl:value-of select="translate(., '<', '')"/>
</xsl:template>
in any XSLT version or
<xsl:template match="field">
<xsl:value-of select="replace(., '<', '')"/>
</xsl:template>
in XSLT 2 or later.