I created a new project in Eclipse just to validate a xml thanks to the corresponding xsd. I wrote both the xsds and the xml files.
The main XSD is like:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.myurl.com/schemas"
targetNamespace="http://www.myurl.com/schemas"
version="1.0">
<xs:include schemaLocation="other_xsd.xsd"/>
[...]
The other_xsd.xsd
is in the same directory and is like:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.myurl.com/schemas"
targetNamespace="http://www.myurl.com/schemas">
It mostly contains complexType
s used in the main xsd
The xml example file also is in the same directory and is like:
<?xml version="1.0" encoding="UTF-8"?>
<myTag xmlns="http://www.myurl.com/schemas" myAttributes="2011-09-07">
All those three files have been loaded within the same directory in my Eclipse project. Yet I keep having this warning:
No grammar constraints (DTD or XML schema) detected for the document. example.xml XMLValidation/Test line 1 XML Problem
What is missing in my xml or in my xsd so that I can validate my xml file?