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

Gordon Kramer gkr at as-guides.com
Tue May 13 13:36:21 EDT 2008


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20080513/1e6729ec/attachment.pgp


More information about the xsd-users mailing list