Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » validation errors on inline svg in html5 files
validation errors on inline svg in html5 files [message #1829086] Thu, 25 June 2020 02:54 Go to next message
Stacy Staff is currently offline Stacy StaffFriend
Messages: 1
Registered: June 2020
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.
Re: validation errors on inline svg in html5 files [message #1829087 is a reply to message #1829086] Thu, 25 June 2020 04:41 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3749
Registered: July 2009
Senior Member

At the moment, there isn't a solution. There's not a prewritten machine-consumable grammar of what's valid in SVG elements that I know of (neither the published version nor the current candidate), and it would take a fair amount of effort for someone to build it. Adding support would be related to bug https://bugs.eclipse.org/324549 .

Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Can't get classes in Referenced Libraries recognized.
Next Topic:Disable Preview Changes Dialog ?
Goto Forum:
  


Current Time: Sun Jul 05 11:47:45 GMT 2020

Powered by FUDForum. Page generated in 0.02878 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top