Hi list,

I'm a developer on a major software project and I have just traced down a 
problem to a possible bug or misconfiguration in XMLBeans.  I can only 
speculate 
that XMLBeans does not like plural words.  Let me describe the problem, with 
names changed to protect "proprietary information"...

Suppose that I have an XSD schema declared approximately like so:

<?xml version="1.0" encoding="UTF-8"?>

  .
  .
  .
  <xs:complexType name="Model">
    <xs:attribute name="id" type="xs:string"/>
    <xs:sequence>
      <xs:element name="Type">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="Statistical" />
            <xs:enumeration value="Heuristic" />
            <xs:enumeration value="Bayesian" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  .
  <xs:complexType name="FrotzModel">
    <xs:complexContent>
      <xs:extension base="midas:Model">
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>  
  .
  .
  .
</xs:schema>

etc.  I validate, compile, and jar up the XSD using XMLBeans.  No problem.  I 
then do something like this:

FrotzModel blorb = FrotzModel.Factory.newInstance();
blorb.setID("model id");
blorb.setType(Model.Type.STATISTICAL);

At this point, a printout of the XML structure displays the following:


  <mida:Type>Statistical</mida:Type>
</xml-fragment>

Somehow, XMLBeans thinks "midas" is the plural of "mida" and has helpfully 
dropped the S since I only have one of them.  But that's not what I want!  Our 
suite of programs depends on the namespaces being propagated correctly, and 
"mida" clearly does not equal "midas", resulting in a failed parse of the XML.

I am earnestly hoping that this is a simple configuration option that I am just 
not aware of; I would find it very surprising if this were a bug.  I am 
basically a beginner at XSD schemas, so it is entirely possible I missed 
something.  Nevertheless, it is a show-stopper preventing me from making 
forward 
progress.  I have searched Google, the XMLBeans FAQ, and the mailing list but 
have not found anything useful.  I am hopeful that this list will provide me 
with enlightenment. :)

Thanks,
Justin



      

Reply via email to