From d616ee160385bfb4f2edc11203b645642f3783ef Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Oct 2012 16:06:53 +0200 Subject: Fix bug in cardinality calculation --- xsd/processing/cardinality/processor.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xsd/processing/cardinality/processor.cxx b/xsd/processing/cardinality/processor.cxx index 8356ee8..0fcabed 100644 --- a/xsd/processing/cardinality/processor.cxx +++ b/xsd/processing/cardinality/processor.cxx @@ -144,7 +144,13 @@ namespace Processing else { ei.min = j->second.min < ei.min ? j->second.min : ei.min; - ei.max = j->second.max > ei.max ? j->second.max : ei.max; + + // Unbounded is encoded as 0. + // + if (j->second.max == 0 || ei.max == 0) + ei.max = 0; + else + ei.max = j->second.max > ei.max ? j->second.max : ei.max; } } -- cgit v1.1