Class XPathAttributeLocator

  • All Implemented Interfaces:
    XPath20Listener, org.antlr.v4.runtime.tree.ParseTreeListener

    public class XPathAttributeLocator
    extends XPath20BaseListener
    Uses the XPath20Parser to extract an attribute from an XPath expression. Arguably one could try to do the same thing using regular expressions, however, with the parser we can handle correctly any XPath expression regardless of how complicated it maybe. The reason we need to examine if an XPath expression points to an attribute is because some eForms Fields represent attribute values. This means that these attributes are effectively hidden behind a Field identifier and cannot be visible by the lexical analyzer or the parser. They are only visible to the translator after dereferencing such Field identifiers. At this point, the translator relies on this class to detect the presence of such attributes and translate accordingly.