Hi,

  I'm having problems to generate code for a namespaced schema that
imports another one without a namespace. For example, for an XML like
this:

<test:a xmlns:test="test">
        <b1>
                <c>Test</c>
        </b1>
        <b2>
                <c>Test</c>
        </b2>
</test:a>

  I have the following schemas:

1) test.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified" targetNamespace="test"
xmlns:test="test">
  <xs:import schemaLocation="no_namespace.xsd"/>
  <xs:element name="a">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="b1"/>
        <xs:element ref="b2"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

2) no_namespace.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
  <xs:element name="b1" type="c"/>
  <xs:element name="b2" type="c"/>
  <xs:complexType name="c">
    <xs:sequence>
      <xs:element ref="c"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="c" type="xs:NCName"/>
</xs:schema>

 and I get the following error:

Fatal: Referenced element '{test}:b1' is not defined for element at
(line 7, col 31, in test.xsd)
FATAL codegen.CodeGen - Referenced element '{test}:b1' is not defined
for element at (line 7, col 31, in test.xsd)
Fatal: Referenced element '{test}:b2' is not defined for element at
(line 8, col 31, in test.xsd)
FATAL codegen.CodeGen - Referenced element '{test}:b2' is not defined
for element at (line 8, col 31, in test.xsd)
FATAL codegen.CodeGen - Terminating processing: Terminating due to
errors in input schemas


  For some reason it's trying to locate the unnamespaced elements in
the "test" namespace.

  Am I doing something wrong? Is this a bug in JIBX? Is there any
work-around for this?

  Thanks!

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to