[xsd-users] problem with namespace mapping

stephane ancelot sancelot at free.fr
Fri May 14 11:05:36 EDT 2010


I have probleme when parsing my xml file, I have always this error :


outillage_default.xml:3:64 error: schema document 'outillage.xsd' has  
different target namespace from the one specified in instance document  
'outillage'
outillage_default.xml:3:64 error: no declaration found for element  
'outillage'
outillage_default.xml:3:64 error: attribute 'machine' is not declared for  
element 'outillage'

xsd cxx-tree  --namespace-map outillage.xsd="outillage" outillage.xsd

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">
   <xsd:element name="outillage">
     <xsd:annotation>
       <xsd:documentation>Definition de l'outillage.</xsd:documentation>
     </xsd:annotation>
     <xsd:complexType>
       <xsd:sequence>
         <xsd:element name="nez">
           <xsd:complexType>
             <xsd:sequence>




outillage.xml :

<?xml version="1.0" encoding="UTF-8"?>
<outillage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="outillage outillage.xsd" machine="">
   <nez numero="1870O001_10">
     <geometrie localId="0" nom="nez" xt="150.00" e="1.05"  
symetrique="true" x1="126.00" r1="5" a1="135.00" xm="126.00"/>
     <primitives>
       <arc localId="0_0" h="0" xc="24" yc="5.525" r="5" ar="-90"  
au="-135"/>
       <segment localId="0_1" h="0" x="24" y="0.525" vx="1" vy="0" l="126"/>

Any idea ?
Best Regards
Steph



More information about the xsd-users mailing list