sweenal / opencollada

Automatically exported from code.google.com/p/opencollada
0 stars 0 forks source link

Wrong validation code generated for <xs:choice maxOccurs="unbounded"> #154

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
For an element of type <xs:choice maxOccurs="unbounded"> the following 
validation code is generated:

if ( parentValidationData->rotate >= 1 ) // maxOccurs
{
    if ( handleError ( ParserError::SEVERITY_ERROR_NONCRITICAL, ParserError::ERROR_VALIDATION_MAX_OCCURS_EXCEEDED, HASH_ELEMENT_ROTATE, (const ParserChar*)0, 0 ) )
        return false;
}
...

However, no validation concerning the number of child elements is required in 
this case.

Original issue reported on code.google.com by opencollada2@googlemail.com on 17 Jan 2011 at 11:20

GoogleCodeExporter commented 8 years ago
Similar problem occurs for 

<xs:choice minOccurs="0" maxOccurs="unbounded">

if ( validationData->translate == 0 && validationData->rotate == 0 ) // no 
child present
  if ( handleError ( ParserError::SEVERITY_ERROR_NONCRITICAL, ParserError::ERROR_VALIDATION_CHOICE_NO_CHILD_PRESENT, HASH_ELEMENT_FRAME_ORIGIN, (const ParserChar*)0, 0 ) )
    return false;

in ColladaParserAutoGen15Private::_validateEnd__frame_origin

Original comment by opencollada2@googlemail.com on 18 Jan 2011 at 11:44

GoogleCodeExporter commented 8 years ago

Original comment by opencollada2@googlemail.com on 26 Jan 2011 at 8:32