<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-15"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Gérald GIRAUD escribió:
<blockquote
 cite="mid1085.82.250.52.237.1151524869.squirrel@webmail.nfrance.com"
 type="cite">
  <pre wrap="">Hello,
We have made some performance tests with XSD and got some surprising results.
Our test program performs the following actions:
We measure the cpu time consumed to read a xml file into a C++ object and
serialize it into another external file (and this 10000 or 100000 times)

In our sample, we only change the "book maxOccurs" from the .xsd file.
      &lt;xsd:element name="book" type="lib:book" maxOccurs="5"/&gt;

When the maxOccurs=5, the measured time is 5 seconds.
When the maxOccurs=500, the mesaured time is 141 seconds, and this with
the same data (library_3.xml that contains only 3 books declared) !
Is there a way to fix this problem. Maybe our code is not correct : is it
possible to ensure the performance of XSD in that sample (even for
maxOccurs=5) ?
I join the sources of our sample (driver.cxx, library.xsd and library.xml)
Thanks
Gérald
  </pre>
</blockquote>
¿Have you tried to change maxOccurs to "unbounded"?<br>
<br>
I'm still too newbie, but in<br>
<a class="moz-txt-link-freetext" href="http://xml.apache.org/xerces-c/schema.html">http://xml.apache.org/xerces-c/schema.html</a><br>
they say:<br>
"Due to the way in which the parser constructs content models for
elements with complex content, specifying large values for the
minOccurs or maxOccurs  attributes may cause a stack overflow or very
poor performance in the parser. Large values for minOccurs should be
avoided, and <b>unbounded should be used instead of a large value for
maxOccurs</b>."<br>
<br>
XSD is based on Xerces, so, maybe, this is the problem.<br>
But don't trust on me: I'm just beginning with XSD. ;)<br>
<br>
--<br>
Raúl.<br>
<br>
</body>
</html>