Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse web.xml formatting errors

 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a sample web.xml like this.



But when I add that in eclipse sometime I get "The content of element type web-app must match icon? display-name ? etc." error message. When I create a new xml file and paste above text there it works. Once I restart the workbench it appears again. I do not see a problem with this web.xml file. What would be the reason? I am using eclipse ganymede.

Thank you

[ October 29, 2008: Message edited by: Dilshan Edirisuriya ]

[edited XML]
[ October 29, 2008: Message edited by: Jeanne Boyarsky ]
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohhhhh

The XML tags are missing in the above post. What is going on here. I cannot copy a xml document here. Look what has happened. Some of the xml data I pasted are missing and some of them are formatted incorrectly. When I click on edit button again I see the correct pasted data there.


[ October 29, 2008: Message edited by: Dilshan Edirisuriya ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dilshan,
You need to escape the < as &lt;. I've edited your post to see the XML.

Your file seems ok. One thing to try is to add a space to the file and save. That might clear Eclipse's cache and get it to acknowledge the file is ok. This helped me with a different XML problem in the past.
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne.

I think it is better to have some sort of a editor component here. Like WYSIWYG. Otherwise we will be having a bad time typing here.

So about the issue, yes I think its something to do with the Eclipse cache. When I edit the file It works fine as you said. So any suggestion cos every time it is hard to edit like this.

Thank you
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric posted a tool to escape the HTML/XML for you:
http://faq.javaranch.com/java/EscapeHtml

I don't know what to say - report it to Eclipse as a bug?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic