CAST HIGHLIGHT - Keyword Scan - Schemas validity error : Element 'filename': This element is not expected. Expected is one of ( content, regexContent )

After analyzing customized Keyword scan (keywordscan.xml) setup, patterns (here, Angular) are not showing up in the dropdown as shown below. 

mceclip0.png

 

Details

The below error was found in the log-

INFO  perl: out: [KeywordScan] ERROR XML: file:/D:/CASTHLKeywordscan/KeywordScan.xml:0: Schemas validity error : Element 'filename': This element is not expected. Expected is one of ( content, regexContent ).
INFO  perl: out: file:/D:/CASTHLKeywordscan/KeywordScan.xml:0: Schemas validity error : Element 'filename': This element is not expected. Expected is one of ( content, regexContent ).
INFO  perl: out: file:/D:/CASTHLKeywordscan/KeywordScan.xml:0: Schemas validity error : Element 'filename': This element is not expected. Expected is one of ( content, regexContent ).

 

Workaround

The KeywordScan.xml provided by the user was not correct in certain areas. 

  1. There should not be multiple filenames for a given search id. Please limit it to a single filename for a single search.
  2. There are some <> characters in <content> that are interpreted as being a tag. These should be replaced with &lt; and &gt; respectively. 

    Please find the below. 
     
    Example for Incorrect Syntax 
         <search id="net2">
        <filename>*.csproj</filename>
        <filename>*.vbproj</filename>
        <content><TargetFrameworkVersion>v2.0</TargetFrameworkVersion></content>
         </search>

    Example fixed

    <search id="net2">
    <filename>*.csproj</filename>
    <content>&lt;TargetFrameworkVersion&gt;v2.0&lt;/TargetFrameworkVersion&gt</content>
    </search>

  3. Re-launch the scan once the changes are made and validated.
  4. You will see the patterns appear in the dropdown.

CAST HIGHLIGHT - Keyword Scan - Schemas validity error - : Element 'patternGroup': This element is not expected. Expected is ( keywordGroup )

 

Additional Resources

CAST Highlight Troubleshooting Guides

CAST Highlight Product Documentation

Have more questions? Submit a request

Comments

Powered by Zendesk