[xsd-users] problem with namespace mapping
Boris Kolpackov
boris at codesynthesis.com
Fri May 14 11:48:22 EDT 2010
Hi Stephane
stephane ancelot <sancelot at free.fr> writes:
> outillage_default.xml:3:64 error: schema document 'outillage.xsd' has
> different target namespace from the one specified in instance document
> 'outillage'
>
> [...]
>
> outillage.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:onx="outillage.xsd"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:ns1="outillage.xsd"
> targetNamespace="outillage.xsd"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified">
>
Your schema has 'outillage.xsd' as its target namespace. This means
that all the elements in your vocabulary are in this namespace.
> outillage.xml :
>
> <outillage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="outillage outillage.xsd" machine="">
Your instance document uses the outillage element (and other elements)
unqualified while your schema says they should be in the 'outillage.xsd'
namespace. Try adding the xmlns="outillage.xsd" to the root element:
<outillage xmlns="outillage.xsd" ...
Also, your xsi:schemaLocation value is incorrect. The first part in
the pair of values should be the namespace which is 'outillage.xsd'
in your case, not 'outillage'.
Boris
More information about the xsd-users
mailing list