[xsde-users] possible bug or misunderstanding/setup issue?

Jim Dattolo jdattolo at dekaresearch.com
Mon Dec 29 21:22:10 EST 2014


I am building up some code from a set of very simple XSD files and I am noticing that inner simple anon types are being instantiated at the upper level and are colliding when linked.  Here are the two xsd files:

****** from TestClass1Type.xsd ****************

<?xml version="1.0"?>

<xs:schema
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" >

   <xs:element name="TestClass1" type="TestClass1Type"/>

   <xs:complexType name="TestClass1Type">

     <xs:sequence>
       <xs:element name="data" type="xs:unsignedByte"/>

       <xs:element name="InnerSimpleType">
          <xs:simpleType>
             <xs:restriction base="xs:unsignedByte" >
                <xs:minInclusive value="10"/>
                <xs:maxInclusive value="64"/>
             </xs:restriction>
          </xs:simpleType>
       </xs:element>
      </xs:sequence>
      <xs:attribute name="attr" type="xs:string" default="SampleAttribute"/>
   </xs:complexType>

</xs:schema>

****** from TestClass2Type.xsd ****************


<?xml version="1.0"?>



<xs:schema

   xmlns:xs="http://www.w3.org/2001/XMLSchema"

   xmlns:xsd="http://www.w3.org/2001/XMLSchema" >



   <xs:element name="TestClass2" type="TestClass2Type"/>



   <xs:complexType name="TestClass2Type">



     <xs:sequence>

       <xs:element name="data" type="xs:unsignedByte"/>



       <xs:element name="InnerSimpleType">

          <xs:simpleType>

             <xs:restriction base="xs:unsignedByte" >

                <xs:minInclusive value="0"/>

                <xs:maxInclusive value="22"/>

             </xs:restriction>

          </xs:simpleType>

       </xs:element>

      </xs:sequence>

      <xs:attribute name="attr" type="xs:string" default="SampleAttribute"/>

   </xs:complexType>



</xs:schema>





In both .cxx/.ixx files a class is made at the upper level like so:



// InnerSimpleType

//



InnerSimpleType::

InnerSimpleType ()

{

}



Which then collides at the linker.  Why are the anon types being called by the local name in the .cxx file at the definition time and not a class name with a incrementing number in it which then is referenced in the upper class by the local name?  pyxb uses STD_ANON_XXX for them.  Both inner anon simple types are _different_ yet the code that is generated is the same, neither have any of the facets for the min/max.  This is the same basic xsd structure that is working in both pyxb as well as jaxb.  Is there a xsde compiler switch/option that I am lacking?  I have been basing my builds out of the custom binary hybrid makefile.  My goal is to only use the binary stream part of the system and none of the xml parsing/serialization (that is being handled in pyxb and jaxb.)  This code just handles binary packets based on the XSD definitions.  I don't believe that I need the full blown XSD compiler, is it possible that only the full version will support encapsulating inner anon types with the same names?



-Jim





________________________________
This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.


More information about the xsde-users mailing list