0

I have created an XSD schema in Eclipse, and then created an XML file off of it. I am unable to get my XML to validate at all. No matter chat I do to my XML, including removing ending tags and the like, when I click "validate" it tells me there are no error.

I've tried creating an XML Catalog entry, but that didn't help. Does anyone have any idea of what my issue might be?

Girevik
  • 13
  • 3
  • One other bit of info. When I hover over elements in Eclipse, I am getting the context sensitive help so I know it's aware of the XSD. For some reason I'm just not getting error marked for me. – Girevik Oct 13 '14 at 11:20

2 Answers2

1

Have you also enabled validation through the preferences? Eclipse Screenshot ------Old Answer------

You have to include the reference to the Schema in the XML file to enable validation. Example: http://www.w3schools.com/schema/schema_howto.asp

<?xml version="1.0"?>

<note
xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com note.xsd">
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note> 
markbernard
  • 1,412
  • 9
  • 18
  • I believe that's there by default of building the XML from the schema, and that's what I've added to the XML Catalog. My XML looks like this: – Girevik Oct 10 '14 at 17:16
  • Yes, validation is enabled. – Girevik Oct 13 '14 at 11:19
  • Are you behind a firewall? You might need to put proxy settings in Eclipse. If that is not it I am not sure what else it could be. It works for me. – markbernard Oct 14 '14 at 21:58
0

I found the issue. Under "validation" all of the options were turned off. Once I enable that, it started working as I expected. Thanks for the help.

Girevik
  • 13
  • 3