replace-xpath

In a regex parser, replace the current "active" string with the result of the evaluation of an XPath expression.

Attributes

Children

Examples

Input Example:

<parser name="p">
<match token="ok">
<add-document/>
<replace-xpath select="concat('concat ', viv:current-string())"/>
<add-content name="c"/>
<add-processed-xsl to="document">
<xsl:template match="/">
<content name="d">
<xsl:value-of select="name(viv:current-node())"/>
<xsl:value-of select="viv:current-string()"/>
</content>
</xsl:template>
</add-processed-xsl>
</match>
</parser>
<parse parser="p">ok</parse>

Output Example:

<parser name="p">
<match token="ok">
<add-document/>
<replace-xpath select="concat('concat ', viv:current-string())"/>
<add-content name="c"/>
<add-processed-xsl to="document">
<xsl:template match="/">
<content name="d">
<xsl:value-of select="name(viv:current-node())"/>
<xsl:value-of select="viv:current-string()"/>
</content>
</xsl:template>
</add-processed-xsl>
</match>
</parser>
<documents>
<document id="Ndoc0">
<content name="c" type="html" action="cluster" weight="1">concat ok</content>
<content name="d" type="html" action="cluster" weight="1">parseconcat ok</content>
</document>
</documents>