lexical error encountered: "<" (60) after ""

When is this lexical error thrown? I have a program where I write test cases in a file. My java program parses the file, test cases are read and executed. In the parsing stage I encounter this error. What could be the reason?


ANSWERS:


You will get such an error message if you submit an HTML document to the W3C CSS Validator. The reason is that a construct like <!DOCTYPE html> makes no sense in CSS and is not allowed even at the lexical level.

I have no idea of how this could relate to a Java program parsing files. My wild guess is that your program processes data and extracts or generates CSS style sheets from it, then passes the style sheets to CSS validation. In that case, something is wrong in the data or in the parsing – either the parser is not prepared to handling HTML (or XML) at all, or it it parses it wrongly.


I'm getting the same errors in my Java compile. Something in your build chain is performing static code analysis using the tool "cpd" (copy/paste detector). It throws lexical errors as it reads your code and fails to parse it. Unfortunately, I'm not sure what exact conditions cause it to fail. I hope that points you in the right direction!



 MORE:


 ? Teradata adding  in front of special characters
 ? Adding element to dictionary breaks encoding
 ? What does this mojibake/krakozyabry on The Simpsons say?
 ? How to make Zend Form element attributes encode HTML elements using correct encoding?
 ? WordPress/PHP Redirect with % sign in URL
 ? Mysql character set and collations - UTF8mb4 520
 ? How do I write utf-8 characters( '\xe7\x8e\xa9' ) into another file as Chinese characters?
 ? How to know the encoding of a file in Python?
 ? Incorporating ISO 8859-1 Symbols / foreign languages into a WinForms application
 ? Camel file component charset with more than one endpoints