SonarQube 7.6 works with xpath 2.0?

(Kilani Sudhir) #1

Hi,

I am writing regular expressions rules in sonarQube 7.6 but they are not working where as if I test in online xpath tester they working well.that means does sonarQube supports regular expressions if yes how can I achieve regular expressions in sonarQube?

My regular exprission in SonarQube is :

Thanks in advance for the help!
matches(//*[local-name() = ‘set-payload’]/@doc:name, ‘[A-Z]’)

I am getting the below error while executing sonar-scanner:

Caused by: javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Could not find function: matches
at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:400)
at org.sonar.plugins.xml.checks.XPathCheck.getXPathExpression(XPathCheck.java:112)
… 46 common frames omitted

(G Ann Campbell) #2

Hi,

The XPath rules only support XPath 1.0.

 
Ann