I am trying out some XML Schema examples and have to validate them with a sample XML File. The schema is a local file (someFile.xsd). I am using eclipse and want to include a reference in the XML file to point to this local xsd file so that eclipse can suggest the elements to me.
Am finding it hard to come up with the syntax to include a local file. Any suggestions ?
Are you using the xsi:schemaLocation
attribute?
Ex:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://foo/target/Namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:someNamespace="someFile"
xsi:schemaLocation="
someFile someFile.xsd" >
...
</root>
I believe someFile.xsd
has to be in your classpath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With