score:1
Eclipse observes the DOCTYPE declaration. In my case, the solution was using the code above at the first line of the files containing HTML code:
<!DOCTYPE html>
Related to that, there's this other question, already answered:
score:2
Eclipse 3.6 introduced a new field under:
Validation -> HTML Syntax: Ignore specified attribute names in validation
Add the OpenGraph, RDFa or other non-HTML5 attributes you want the validator to ignore:
You will need to re-validate the project, then the warnings will be gone.
score:3
I use the Aptana Studio plugin on Mac OS X; if I go Eclipse > Preferences > Aptana Studio > Validation > HTML
, and create the filter *data-role*
I no longer get this warning.
I believe on Windows it is Window > Preferences > Aptana Studio > Validation > HTML
score:4
I used this one with Aptana 3.6 when I'am coding AngularJS
Window > Preferences
score:9
Newer versions of Eclipse support HTML5 tags and the data-* attributes allowed in HTML5. However, when using the role attribute the proper syntax according to the ARIA Roles Model and XHTML Role Attribute Module is not to prefix the role attribute with data-* leaving just role and not data-role.
So <ul role="menubar">
is more correct than <ul data-role="menubar">
. The validity of the syntax can be checked using the (X)HTML5 Validator. jQuery Mobile uses quite extensively the data-role attribute, though I'm not sure why.
Note: If you upgrade and you're still getting warnings on data-* attributes you may want to consider updating or removing any installed syntax-checkers such as JTidy. As of Indigo Service Release 1 the role attribute continues to trigger an undefined attribute warning in Eclipse by default.
score:22
Your doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
is for HTML 4.01.
data-*
attributes were added in HTML 5. The doctype for HTML 5 is basically either
<!DOCTYPE html SYSTEM "about:legacy-compat">
or
<!DOCTYPE html>
score:37
It seems like Eclipse still has some problems validating HTML5 elements and attributes even now.
I'm running Mars 4.5.1 and I have had warnings about the <main>
element, despite the fact that there are no warnings about the <section>
element.
But there is a solution!
Window > Preferences > Web > HTML Files > Validation
Here you can tick the Ignore specified element names in validation
checkbox and enter the names of any elements which Eclipse is incorrectly warning you about.
In your case, you will want to tick the Ignore specified attribute names in validation
checkbox and enter the data-role
attribute.
After you click 'Apply', Eclipse will ask you to do a full validation of the project. Select 'Yes' and the changes will take effect.
No more squiggly yellow lines YAY! :D
Source: stackoverflow.com
Related Query
- Warnings of valid HTML5 attributes in Eclipse
- Eclipse Indigo generating HTML5 warnings in HTML4 snippets
- Eclipse does not recognize some valid attributes and tags
- Eclipse - Unable to install breakpoint due to missing line number attributes
- Eclipse - how to remove light bulb on warnings
- How can I disable compiler warnings in Eclipse on a file specific basis?
- How to find complete list of warnings in eclipse IDE
- Eclipse Maven Projects get rid of wb-resource warnings
- Annoyance - How to disable Eclipse classpath entry warnings
- Eclipse complaining about web-app attributes
- Disable HTML Warnings in Eclipse for Java EE developers edition
- How do I suppress Eclipse 3.5's warnings of dead code
- Eclipse gives too many false errors and warnings on EL expressions in JSF files
- How to get pylint warnings to be marked in the Pydev Eclipse editor margin?
- eclipse maven error: Archive for required library in project cannot be read or is not a valid ZIP file
- Can Eclipse be configured to disable warnings for derived source files?
- Only show warnings from some folders in eclipse
- Ignoring all warnings in an Eclipse project
- Developing HTML5 application with Eclipse IDE
- Eclipse Java Compiler Warnings as ant task
- Eclipse Ganymede HTML editor incredibly slow when editing attributes
- How to get Eclipse Warnings when compiling with maven?
- How do I suppress warnings in Eclipse for PHP?
- Can Eclipse be configured to prevent certain warnings from showing up in the Problems view pane?
- Eclipse - how to set javadoc warnings only to specific folders, not the whole project
- How to turn off warnings for @string resource in eclipse for the Android SDK
- How do I disable Unused Variable warnings in Eclipse in minGW?
- Attributes in the web.xml's <web-app> don't work in Eclipse
- Eclipse Gradle Plugin: <some pom file> cannot be read or is not a valid ZIP file
- How to generate HTML5 valid Javadoc?
More Query from same tag
- Can't create New Android Application in Java Eclipse
- BIRT report modification
- Search over ssh with eclipse
- eclipse - ternary formatting still broken?
- How can i deploy my worklight project to my blackberry device..?
- How to get IProject Properties
- Install Google Play on Eclipse emulator
- java.lang.ClassNotFoundException android + eclipse + maven + osx
- Android - Moving an object in circle
- Trying to use a java api loading so file in Android
- Naming conventions for test cases in Eclipse
- Scala source files not recognized by compiler in Eclipse
- Android Eclipse
- when I try to install a eclipse plugin, It ask for a eclipse.tmatesoft.com a login?
- "Can't find API database; API check was not performed" in Android App SDK with Eclipse
- Android - Read properties file without using context
- Java Eclipse dissecting Java Exception
- Java generics: Bound mismatch: The type is not a valid substitute for the bounded parameter of the type
- force eclipse to sign android apk with public key
- Eclipse plugin rt.jar semms not to be in classpath
- How to split a window multiple times in Eclipse?
- What is this structured comment and what is "updated" field for?
- How to Debug Custom View in ADT's Graphical Layout Editor
- How do I Start Eclipse project with GUI windows spaced out?
- How to install older Android SDK in Eclipse
- Eclipse - Assigning each main method to a separate console
- Need to override windows default file.separator without changing java code
- How do I find usages of class in eclipse?
- How do you get mylyn to open and close projects?
- Red5-server Target Build