[xsd-users] Re: xsd-users Digest, Vol 35, Issue 9 Re: Code generation fails for schemas with large maxOccurs values (Boris Kolpackov)

Roger Evans roger at autodata.no
Wed May 14 02:26:19 EDT 2008


And enforced fixed attributes, too - while you're at it :)


On Tue, 2008-05-13 at 19:36 +0200, Gordon Kramer wrote:
> Hi all,
> 
> Am Dienstag, den 13.05.2008, 12:00 -0400 schrieb xsd-users-request at codesynthesis.com:
> 
> > Hi David,
> > 
> > david.r.moss at selex-comms.com <david.r.moss at selex-comms.com> writes:
> > 
> > > No code is generated when maxOccurs="9957" or greater and when it's a
> > > smaller "large" number the code generation takes a very (very) long time.
> > > I realise that in general this is bad practise as XML validation is slow
> > > with large bounds as mentioned in this previous post:
> > >
> > > http://codesynthesis.com/pipermail/xsd-users/2007-February/000812.html
> > >
> > > but surely the code generation should still work - we may well be stuck
> > > with these schemas.
> > 
> > The XSD compiler uses Xerces-C++ underneath to validate the schemas
> > being compiled. As a result, the same problem with maxOccurs exists
> > when compiling a schema as when validating an instance against it.
> 
> 
> 
> > You also need to do this if you need validation of the instance. In
> > this case you may have to enforce large maxOccurs constrains in the
> > application.
> > 
> 
> Would it be a big problem to implement code generation for enforcing
> maxOccurs>1 outside xercesc validation ?
> Maybe adding the maxOccurs constraint as a template parameter to
> sequence ? 
> This would also help enforcing the constraint when programatically
> adding elements to the sequence. 
> 
> Best Regards,
> Gordon
> 




More information about the xsd-users mailing list