[jdom-interest] Failing early on maxLength violations

J. McConnell jdotmc at gmail.com
Wed Dec 14 06:28:04 PST 2005


On 12/14/05, Michael Kay <mike at saxonica.com> wrote:
> Where exactly does JDOM come into this?

I wasn't completely sure if this was the right list, but it was the
best one I knew of.  If you know a better list, I'll certainly move
the conversation over there.

> In general I don't think that schemas are the right way to impose system
> limits for performance or resource utilisation reasons. Your example tends
> to reinforce this view.

There is a business rule in place on the maximum size of the image, so
my maxLength restriction is not arbitrary and will be used regardless
of whether or not the SAXBuilder uses it early enough.  Does this not
seem appropriate?

> You're better off imposing a limit on the total size of the XML file, which
> is something you can check before you start parsing it.

This is a good suggestion, I'll look into doing this as well.

Thanks,

- J.



More information about the jdom-interest mailing list