XPath Selector Limitations in Meeseeks
mainWhile Meeseeks.XPath supports most of the XPath 1.0 syntax, it has several specific limitations and unsupported features. Understanding these is necessary to avoid runtime errors when constructing queries.
Unsupported features include:
- Top-level filter expressions: Expressions that attempt to filter the entire result set at the top level (e.g.,
xpath("(//ol|//ul)[2]")) are prohibited. - Attribute steps outside of predicates: You cannot select attributes directly as nodes (e.g.,
xpath("//p/@class")). You can only use attributes within predicates to filter elements (e.g.,xpath("//p[@class]")). - Variable references: Expressions using variables (e.g.,
xpath("*[position()=$p]")) are not supported. - Specific XPath functions: The functions
id(),lang(), andtranslate()are not supported. - Namespace resolution: Namespace prefixes are not automatically resolved to URIs. You must search for the prefix itself rather than the expanded URI.
- HTML5 Processing Instructions: When using the
meeseeks_html5everparser, processing instructions are treated as comments.