Hi I am trying to get my mind around XSDs, XML and namespaces but I can't get things to work the way I want them to.
I have an XSD which, at the moment, starts like this:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.com">
<xs:import namespace="http://www.example.com" schemaLocation="Include.xsd" />
As you can see, it imports another xsd file, which starts like this:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified"
targetNamespace="http://www.example.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.com">
Then I have some xml documents based on this schema:
<foobar>
<whatever>....
Basically I don't care what the namespaces are, I just want the darn thing to work. Previously I wasn't using any namespace but it seems that I have to use them in order to import one XSD into another. What I don't want to do is have to supply prefixes to all the elements in my xml documents.
In order to achieve this, what combination of values do I need for the various attributes (targetNamespace, namespace, xmlns, elementFormDefault etc) in the XSD and XML documents?
Currently, any elements defined in the imported XSD document require namespace qualification in the XML.