Eclipse XML Validation can BITE ME

15 07 2008

There are times when I want to take an axe to Eclipse. Today’s particular grief is due to the XML editor. There are numerous faults with it (one of the biggest is that it ‘captures’ the control-pgup and control-pgdn keys into local tabs, so if you have an XML file open, and you use the keystrokes to navigate through your files, when you switch tabs to an XML file, the only way you can view a different file is to click on it), but todays stabbity-stab comes from the validator.
eclipse-48Eclipse shows you errors and warnings in realtime. Usually, they’re fairly accurate. Today I was editing a struts.xml file, and was getting a validation warning. When Eclipse senses a problem with the XML (based on it’s DTD), it tells you “this XML file fails the DTD validation”.
But it doesn’t tell you where.
This completely baffles me. “Somewhere in the following several hundred lines of XML code, there’s a problem. But I won’t tell you where or what it is.”
Off to the Validation service. I fed the XML file into it, and lo! A detailed description of the problem, and where it was:

Line 26, Column 39:
document type does not allow element "include" here.

<include file="struts-editevent.xml"/>

Was that really that difficult?



6 responses

15 07 2008

If you ping me tomorrow, I can find out what XML editor we use w/ Eclipse. 🙂

18 07 2008
Doctor Memory

It’s not free, and I totally get why you wouldn’t want to have to jump out of Eclipse into another program just to edit an XML file, but…
oXygen rocks so hard it’s in danger of breaking the spacetime continuum.
Just sayin.

31 07 2008
David Carver

If you can reliably reproduce this, I would suggest opening a bug report with eclipse. You also don’t mention what version of eclispe your are running. There are a LOT of errors in eclipse wtp 2.0, eclipse wtp 3.0 is much better, but still not perfect. Feel free to drop me a note, I’m a committer on the eclipse XSL Tools project so glad to help work through any issues.

13 02 2009
Akbar Pasha

I have created one editor. Now i want to add the capabilities of xml editor like validating and xml content assistant to my editor. How can i do that. please can anybody help me. I am eagerly waiting for the reply. Thanks in advance.

4 03 2009
David Carver

Akbar: Do a google search on XML Editor EclipseCon 2006. That should take you to a tutorial on doing what you want.

22 04 2012

I can get just about everything I need to do from Liquid XML Editor, but I still need to jump back into Eclipse, look forward to the plugin, just an idea.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: