validation errors on inline svg in html5 files [message #1796006] |
Wed, 03 October 2018 23:19 |
Steffen Erlecke Messages: 1 Registered: October 2018 |
Junior Member |
|
|
Hallo guys,
I'm not totally new to Eclipse, XML and HTML5. But what I now try to do is new to me. I'd like to put some inline svg into a html file. This is quite simple, works perfect, but gives me ugly warnings about unknown tags and attributes in Eclipse.
So I googled for two days, found nothing working for me and went out of ideas. First I tried to add xmlns:svg="https : //www.w3.org/2000/svg" to my svg tag, later to my html tag. Then I tried to add catalog entries to the Eclipse XML catalog but didn't find a perfect example, so I don't know if I did something wrong. For now I deleted this entry without any effect. I tried to ignore the tags and attributes for validation by setting them to "web > html files > validation > ignore specified ... ". This is not working for attributes like "xlink:href" as they are not accepted in the input dialog.
At this forum I found a post from 2012 pointing to that problem, but without any answer. So for now I hope that someone can help me out.
I lately took the example code from https : //www.w3schools.com/html/html5_svg.asp:
<!DOCTYPE html>
<html>
<body>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
</body>
</html>
I get a circle as expected in all browsers. I also get 9 warnings from Eclipse like that:
Description Resource Path Location Type
Undefined attribute name (cx). test.html /xxx line 6 HTML Problem
Undefined attribute name (cy). test.html /xxx line 6 HTML Problem
Undefined attribute name (fill). test.html /xxx line 6 HTML Problem
Undefined attribute name (height). test.html /xxx line 5 HTML Problem
Undefined attribute name (r). test.html /xxx line 6 HTML Problem
Undefined attribute name (stroke-width). test.html /xxx line 6 HTML Problem
Undefined attribute name (stroke). test.html /xxx line 6 HTML Problem
Undefined attribute name (width). test.html /xxx line 5 HTML Problem
Unknown tag (circle). test.html /xxx line 6 HTML Problem
If at the other hand I try to push the "unknown tags" into the svg namespace, I become no warnings, errors or such. Eclipse is super happy about that, but my browsers are looking sadly to me, showing me blank pages because this properbly breaks the html5 rules.
<!DOCTYPE html>
<html xmlns:svg="http : //www.w3.org/2000/svg" xmlns:xlink="http : //www.w3.org/1999/xlink">
<body>
<svg:svg width="100" height="100" xmlns:svg="https : //www.w3.org/2000/svg">
<svg:circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg:svg>
</body>
</html>
So, does anybody has an idea about solving that? First of all, I'd like to get rid of these warnings. The perfect way would be to teach eclipse the correct way to validate this inline svg. But if I could loose the validation of the inline svg without loosing the complete html validation, I would be happy too. Is there another way I don't see?
Thanks a lot so far.
Steffen
PS: I use Eclipse 4.8.0, the WTP and the "normal" html editor
|
|
|
Powered by
FUDForum. Page generated in 0.07574 seconds