Skip to content

Regarding pmd:fileName() function #4629

Closed Answered by oowekyala
allurisriakhil asked this question in Q&A
Discussion options

You must be logged in to vote

You need to set the language of your rule to xml so that it executes on XML files. Preferably use the rule class DomXPathRule too:

<rule name="MyXPathRule"
      language="xml"
      message="A message"
      class="net.sourceforge.pmd.lang.xml.rule.DomXPathRule">

      <properties>
        <property name="xpath">
            <value><![CDATA[
               /*[starts-with(pmd:fileName(), 'SA_')] 
            ]]></value>
        </property>
      </properties>
</rule>

Replies: 1 comment 3 replies

Comment options

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

@allurisriakhil
Comment options

@allurisriakhil
Comment options

Answer selected by allurisriakhil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants