in eclipse to avoid the “ grammar restrictions (dtd or xml) found for the document. ” I use to add the xsd schema file to the xml directory in
"Window \ preferences \ xml \ xml directory \ User Entries."
Click the Add button on the right.
Example:
<?xml version="1.0" encoding="UTF-8"?> <HolidayRequest xmlns="http://mycompany.com/hr/schemas"> <Holiday> <StartDate>2006-07-03</StartDate> <EndDate>2006-07-07</EndDate> </Holiday> <Employee> <Number>42</Number> <FirstName>Arjen</FirstName> <LastName>Poutsma</LastName> </Employee> </HolidayRequest>
From this xml, I generated and saved xsd under: /home/my_user/xsd/my_xsd.xsd
Like the location: /home/my_user/xsd/my_xsd.xsd
As key type: namespace name
As a key: http://mycompany.com/hr/schemas
Close and reopen the xml file and make some changes to break the scheme, you should be notified.
user1374968 May 31 '12 at 14:04 2012-05-31 14:04
source share