Durga
(Durga madhaba nanda)
January 17, 2019, 8:20am
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
Regards
Durga
pynicolas
(Pierre-Yves Nicolas)
January 18, 2019, 2:26pm
3
Try something like:
//*[@tokenValue = 'INDEX']/following-sibling::*[@tokenValue = 'IDX_LASTNAME']
Durga
(Durga madhaba nanda)
January 18, 2019, 2:49pm
4
Thanks for valuable suggestion and how we can use same for logical not.
Regards
Durga
pynicolas
(Pierre-Yves Nicolas)
January 18, 2019, 3:18pm
5
What are you trying to achieve?
What did you try?
Did you find some documentation about XPath?
Durga
(Durga madhaba nanda)
January 21, 2019, 8:37am
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
pynicolas
(Pierre-Yves Nicolas)
January 21, 2019, 12:23pm
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
(Durga madhaba nanda)
January 31, 2019, 9:20am
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
Thanks