Look, you've got this error:
The matching wildcard is strict, but no declaration can be found for element 'stuff'.
Notice, it says nothing about namespaces of elements.
Rather, it just cannot find a declaration for the element stuff
!
Yet, on the surface, it appears you did declare that element:
<xsd:element name="Company">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Product" type="ProductType"
maxOccurs="unbounded"/>
<xsd:element name="stuff" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
So, what's the problem?
The problem is you have declared it locally.
What it actually means is that, according to your schemas,
your <staff>
element can be valid only as a child of <Company>
element.
It must not be found anywhere else!
However, in your XML:
<Product>
<stuff>Widget</stuff>
</Product>
<stuff>text</stuff>
you do want to use <stuff>
also as a child of <Product>
,
which is not provided by your schema.
The XML validator doesn't say that your <stuff>
element cannot be used within
<Product>
because it is local child of <Company>
.
To it, the local element is determined by the path:
Company/stuff
When it finds <stuff>
within <Product>
, it looks for a path:
Company/Product/stuff
which is unknown to it. Then, it just says it cannot find a declaration for <stuff>
. It doesn't analyze further what you might have done wrong.
So, the problem is actually not about namespaces but about locally declared elements. You should redesign your schemas to fix it!