I have faced this error earlier and I fixed it using below procedure
In your eclipse IDE to avoid the below message
"No grammar constraints (dtd or xml schema) detected for the document."
I added the xsd schema file to a xml catalog under below path
"Go to Window \ preferences \ xml \ xml catalog \ User specified entries".
Then you need to click on "Add" button on your right.
<?xml version="1.0" encoding="UTF-8"?>
From above xml I had generated and then saved the xsd under below location: /home/my_user/xsd/my_xsd.xsd
As Location: /home/my_user/xsd/my_xsd.xsd
As key type: Namespace name
As key: http://mycompany.com/hr/schemas
After doing above steps you can close and then reopen the xml file and do some changes to violate the schema, you should be notified