And along with logical not(&&) operature not working properly over plsql xpath rule

(Durga madhaba nanda) #1

hello Team,

While writing PLSQL rule using xpath . &/and operator not working properly . Can you please help with us resolution.

Example: here we want index with

//*[@tokenValue = ‘INDEX’ and @tokenValue = ‘IDX_LASTNAM’]

CREATE INDEX idx_lastname
ON Persons (LastName);

Please suggest with feedback


(Pierre-Yves Nicolas) #3

Try something like:

//*[@tokenValue = 'INDEX']/following-sibling::*[@tokenValue = 'IDX_LASTNAME']

(Durga madhaba nanda) #4

Thanks for valuable suggestion and how we can use same for logical not.


(Pierre-Yves Nicolas) #5

What are you trying to achieve?
What did you try?
Did you find some documentation about XPath?

(Durga madhaba nanda) #6

Thanks //[@tokenValue = ‘INDEX’]/following-sibling::[@tokenValue = ‘IDX_LASTNAME’]…did working .

yes,we are following Xpath 1.0 version. Please share us specific Xpath documentation so that we will follow that for Sonarqube

(Pierre-Yves Nicolas) #7

You already know about @tokenValue and the rest is pure standard XPath 1.0.
The only documentation page about XPath-based custom rules can help to understand to overall approach and the way to set up a custom rule.
However, you have to learn at least the basics of XPath to understand the expressions which you can test using SSLR toolkit: any XPath tutorial you can find will be a good start.

(Durga madhaba nanda) #8


(Durga madhaba nanda) #9

Hello Team,

WE tried but not able to identify .
We need this Xpath rule for PLSQL plugin.

We need Xpath query to identify Capital and small letters . This will help me in more rule creation.

Example :Between SELECT and select