Expression evaluation processor
Core v2.2.0
The
processor explicitly evaluates template expressions and returns their values.
Mostly used for XPath-style value extraction and when you need explicit expression evaluation.
In most cases, direct ${} syntax is simpler and preferred.
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<def var="productName">WebHarvest Pro</def>
<def var="price">99.99</def>
<!-- Explicit evaluation -->
<def var="description">
<value-of expr="${productName} - $${price}"/>
</def>
<!-- Simpler alternative -->
<def var="description2">${productName} - $${price}</def>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<def var="xmlData">
<html-to-xml>
<http url="https://example.com/product"/>
</html-to-xml>
</def>
<def var="productTitle">
<value-of expr="//h1[@class='product-title']/text()"/>
</def>
<def var="productPrice">
<value-of expr="//span[@class='price']/text()"/>
</def>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<def var="baseUrl">https://api.example.com</def>
<def var="endpoint">/v1/products</def>
<def var="apiKey">abc123</def>
<def var="fullUrl">
<value-of expr="${baseUrl}${endpoint}?key=${apiKey}"/>
</def>
<!-- Alternative syntax -->
<def var="fullUrl2">${baseUrl}${endpoint}?key=${apiKey}</def>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<!-- When you need to ensure expression is evaluated in specific context -->
<def var="dynamicContent">
<value-of expr="${userInput}"/>
</def>
<!-- For debugging - explicit evaluation shows what's being processed -->
<log message="Processing: ${dynamicContent}"/>
</config>