Thrift: Fix xsd:sequence and xsd:all minOccurs/maxOccurs generation
authordave <dev-null@apache.org>
Thu, 1 Feb 2007 00:17:28 +0000 (00:17 +0000)
committerdave <dev-null@apache.org>
Thu, 1 Feb 2007 00:17:28 +0000 (00:17 +0000)
commit29cbeb6235f6637f2584715cf3ea37cf6a371653
tree95ed44190de07d0a6ceaf5b684d9b6dcb96d8af8
parentcb126a0c196a14734194c983452f702f16c9c929
Thrift: Fix xsd:sequence and xsd:all minOccurs/maxOccurs generation

The minOccurs and maxOccurs attributes should appear on the elements, rather than the containers.

for a thrift struct, we produce:
<sequence>
<element name="some_element"> <!-- max is implicitly 1 -->
<element name="some_optional_element" minOccurs="0"> <!-- max is
implicitly 1 -->
...

for a thrift list, we produce
<sequence>
<element name="the_list_element" minOccurs="0" maxOccurs="unbounded">
</sequence>

for a thrift struct tagged with xsd_all, we produce

<all>
<element name="some_element" minOccurs="0"/>  <!-- max is implicitly 1
-->
</all>

Reviewed By: mcslee

Test Plan: sandbox

Revert Plan: revertible

Notes:

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664962 13f79535-47bb-0310-9956-ffa450edef68
compiler/cpp/src/generate/t_xsd_generator.cc
compiler/cpp/src/generate/t_xsd_generator.h