[xsd-users] Fwd: Suspect a Bug in Generic Class generation for C++

subrahmanyam g subbu.klce at gmail.com
Wed Mar 20 12:23:12 EDT 2013


Hi Sir,

   I have gone through an issue with the parsing method for xml using
Generic class generation for c++.My xsd is a very big one.so i can give you
a sample example which replicates the same here.

*ex:*
<root>
<xs:element name="A2GTFT"   minOccurs ="0"   maxOccurs ="1">
  <xs:complexType>
     <xs:sequence>
                <xs:element name="entry"    type="xs:string"
minOccurs="1"  maxOccurs="255"/>
      </xs:sequence>
     </xs:complexType>
 </xs:element>
</root>

According to above schema A2GTFT element is an optional element. So it
should allow only one instance otherwise it should throw an error.
*ex: *This is the sample xml for the above schema
<root>
 <A2GTFT>
      <entry>string1<entry>
      <entry>string2<entry>
 </A2GTFT>
</root>
But the problem i have overcome across was
*ex:*

<root>
 <A2GTFT>
      <entry>string1<entry>
      <entry>string2<entry>
 </A2GTFT>
* <A2GTFT>           *                   <!-- should not allow one more
element because not an array -->*
      <entry>string1<entry>
      <entry>string2<entry>
 </A2GTFT> *
</root>

Additional A2GTFT element should cause a error at run time.But our
codesynthesis method is allowing the above xml & moreoever its not using
the second element. (considering the first element)

Expected behavior is throwing an error at run time.
I will give more details if needed.I hope i 'll get the reply soon.


More information about the xsd-users mailing list