Skip to content
\n

And I want to write a rule that hits, if there is \"No\" in description.

\n

I have the following rule in my ruleset

\n
<rule name=\"GettingNo\" language=\"xml\" message=\"TEST\" class=\"net.sourceforge.pmd.lang.rule.xpath.XPathRule\">\n        <properties>\n            <property name=\"xpath\">\n\t        <value><![CDATA[\n               PermissionSet[contains(description, 'No')]\n            ]]></value>\n            </property>\n        </properties>\n    </rule>\n
\n

According to xpath-checker, my xpath is hitting for my example. However, if I execute my ruleset, I don't get a result (and no error).

\n

What am I doing wrong? Any help is highly appreciated and would make my day ;)

","upvoteCount":1,"answerCount":4,"acceptedAnswer":{"@type":"Answer","text":"

FYI: without DomXPathRule the XPath expression looks like this:

\n
PermissionSet[description/text[contains(@Text, 'No')]]\n
","upvoteCount":2,"url":"https://github.com/pmd/pmd/discussions/5769#discussioncomment-13307152"}}}
Discussion options

You must be logged in to vote

FYI: without DomXPathRule the XPath expression looks like this:

PermissionSet[description/text[contains(@Text, 'No')]]

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by remehl
Comment options

You must be logged in to vote
3 replies
@adangel
Comment options

@oowekyala
Comment options

@jsotuyod
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants