Friday, December 14, 2012

maxOccurs

When fixing a "Unbounded Occurrences" bug for HP Fortify, there may be a place in a .xsd for a dataset (let's say the database is Foo.xsd) which looks likes so...

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

 
 

...and must become like so:

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

 
 

Where did 79228162514264337593543950335 come from? It came from a line in the Designer file which gives away the type used for maxOccurs:

any1.MaxOccurs = decimal.MaxValue;

 
 

Get a number from an appropriate type.

No comments:

Post a Comment