xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ne...@ca.ibm.com
Subject Re: [Xerces1.2.2][XMLSChema]
Date Tue, 05 Dec 2000 15:15:42 GMT



Hi Sebastien and Andy,

Andy, actually there's another way to implement <all> using <choice> and
<sequence> that produces fewer than n! sequences; I implemented it and Eric
committed it last week, I believe.  It didn't make it into Xerces 1.2.2
though.  (If anyone's interested I'll send them my algorithm off-line; I
thought it was kind of cool anyway.  :-) )  The new approach gets us up to
8 elements, and is a lot faster than the old approach as well.

But Sebastien, I'd love to see your code so that I could test it; this is
young code so would be good to make sure it's working.

Cheers!
Neil

Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  416-448-3519, T/L 778-3519
E-mail:  neilg@ca.ibm.com



Andy Clark <andyc@apache.org> on 12/04/2000 08:31:41 PM

Please respond to xerces-j-dev@xml.apache.org

To:   xerces-j-dev@xml.apache.org
cc:
Subject:  Re: [Xerces1.2.2][XMLSChema]




Sebastien Sahuc wrote:
> Just to let you know that I get a java.lang.OutOfMemoryError (it looks
> like it goes into an inifite loop before reaching it memory limit.)
> when I replace any <group> statement with a <all> statement.

Let me guess, you have 7 or more elements in your <all>...

This is an inherent problem with the <all> model because it's
a factorial problem. Consider: a & b & c (old SGML syntax). This
is equivalent to the following: (a,b,c) | (a,c,b) | (b,a,c) |
(b,c,a) | (c,a,b) | (c,b,a). So it's really 3! == 6 sequences
of 3 elements. If you do the math for 7! (or higher) I think
you'll see the problem.

Our current content model code can only handle sequences and
choices, so the <all> gets expanded to all of its permutations.
You're more than welcome to come up with some code to fix this
problem that handles the <all> in a more efficient manner. But
at the moment, this is lower priority than other items.

--
Andy Clark * IBM, TRL - Japan * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org





Mime
View raw message