You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Christoffer Dam Bruun <cb...@systematic.dk> on 2001/08/21 13:15:09 UTC
Stack overflow/(very)poor performance if maxOccurs in a schema d
efinition is too big e.g. 1000
We run Xerces v1.5.0
We are validating a 1600 bytes xml-msg using StdInParse
sample from our schema file:
<!-- FONKOD -->
<element name="FONKOD">
<complexType>
<sequence >
<element ref="KURSOP" minOccurs="1" maxOccurs="1"/>
<element ref="LAANOP" minOccurs="1" maxOccurs="10"/>
</sequence>
<attribute name="Fondskode" type="AN12" use="required"/>
<attribute name="Valutakode" type="AN3"/>
</complexType>
</element>
If maxOccurs is set to 10 we can validate the msg in 100msec
if maxOccurs is set to 1000 it takes 6sek!
if maxOccurs is set to 10000 we get a stackoverflow:
The entire stack is used for calls to this function: CMNode*
DFAContentModel::buildSyntaxTree(ContentSpecNode* const curNode)
It seems as if Xerces is generating a state in the DFA for each possible
repetition....
/Christoffer
m.v.h.
Christoffer Bruun
email: cb@systematic.dk
tlf: 89432000
---
Ed is the standard text editor.
If you use ed, you are on the path to redemption, the
so-calleds "visual" editors have been placed here by ed to tempt the
faithless. DO NOT GIVE IN!!! THE MIGHTY ED HAS SPOKEN!!!
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org