sshyran / genxdm

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

XMLSchemaParser does not enforce mutual exclusion between "nillable" and "ref" attributes for local xs:element declarations #119

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For local element declarations, the "nillable" and "ref" attributes cannot both 
be present.  This becomes a problem when the local element attempts to have a 
different value for the "nillable" attribute that the reference element.  In 
our current code (see XmlSchemaParser.elementLocalTag(...)), the new nillable 
value will actually overwrite that of the reference element.  

The solution, I think, is to raise an exception when these mutually exclusive 
attributes are present.  The same fix may need to be applied to the default, 
fixed, form, block, and type attributes.

Original issue reported on code.google.com by joe.bays...@gmail.com on 20 Dec 2012 at 3:07

GoogleCodeExporter commented 8 years ago
One additional note: if the referenced element has a "nillable" value of 
"true", and the referring local element does not have a "nillable" attribute, 
our code assumes a "nillable" value of "false" for the referring element and 
overwrites the referenced element's nillable value with that "false" value.

Original comment by joe.bays...@gmail.com on 20 Dec 2012 at 3:10

GoogleCodeExporter commented 8 years ago
Actually, the only problem with our current implementation is the case I 
mentioned in the last comment, wherein the referring local element does NOT 
have a nillable attribute, and we assume the default value of false and then 
overwriting the referred element's nillable value.

Original comment by joe.bays...@gmail.com on 20 Dec 2012 at 4:18

GoogleCodeExporter commented 8 years ago
r433.  Modified XMLSchemaParser.elementLocalTag(...) method so that for local 
elements with a "ref" attribute, we no longer overwrite the referenced 
element's nillable and block attribute values with the default values of the 
referring element.

Original comment by joe.bays...@gmail.com on 20 Dec 2012 at 4:29