The oxy_xpath() Function

The oxy_xpath() function is used to evaluate XPath expressions.

The oxy_xpath() function has the following signature:

Note: When XPath expressions are evaluated, the entities and xi:include elements are replaced with the actual content that is referenced. For example, consider the following code snippet:
<article>
  <xi:include href="section1.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</article>
where section1.xml contains the following content:
<section>
  <p>Referenced content</p>
</section>
The latter will be the actual content in which the XPath expression is executed.

An Example of the oxy_xpath() Function

The following example counts the number of words from a paragraph (including tracked changes) and displays the result in front of it:
para:before{ 
  content: 
    concat("|Number of words:", 
           oxy_xpath(
                "count(tokenize(normalize-space(string-join(text(), '')), ' '))",
                processChangeMarkers,
                true),
           "| "); 
}