Class Dom4jExtension

java.lang.Object
org.craftercms.engine.util.groovy.Dom4jExtension

public class Dom4jExtension extends Object
Groovy extension module for Dom4j
Author:
avasquez
See Also:
  • Constructor Details

    • Dom4jExtension

      public Dom4jExtension()
  • Method Details

    • get

      public static Object get(org.dom4j.Node node, String xpathExpression)
      Adds a get method to Dom4j nodes, which allows XPath queries through dot notation properties, e.g siteItem.collection.item[1].text. Also, if the result is an Element, then the element will attempted to be converted based on the content model field conversion algorithm.
      Parameters:
      node - the Node object (this)
      xpathExpression - the XPath expression or query
      Returns:
      the result of the XPath query