Exemple #1
0
        public override bool EvaluateEndElement()
        {
            if (head.EvaluateEndElement())
            {
//				return true;
                return(rest.EvaluateIsEmptiable());
            }
            if (!head.EvaluateIsEmptiable())
            {
                return(false);
            }
            return(rest.EvaluateEndElement());
        }
Exemple #2
0
        public override bool EvaluateEndElement()
        {
            if (seq.ValidatedMinOccurs > Occured + 1)
            {
                return(false);
            }
            if (seq.CompiledItems.Count == 0)
            {
                return(true);
            }
            if (currentAutomata == null && seq.ValidatedMinOccurs <= Occured)
            {
                return(true);
            }

            int idx = current < 0 ? 0 : current;
            XsdValidationState xa = currentAutomata;

            if (xa == null)
            {
                xa = Manager.Create(seq.CompiledItems [idx] as XmlSchemaParticle);
            }
            while (xa != null)
            {
                if (!xa.EvaluateEndElement())
                {
                    if (!xa.EvaluateIsEmptiable())
                    {
                        return(false);                          // cannot omit following items.
                    }
                }
                idx++;
                if (seq.CompiledItems.Count > idx)
                {
                    xa = Manager.Create(seq.CompiledItems [idx] as XmlSchemaParticle);
                }
                else
                {
                    xa = null;
                }
            }
            if (current < 0)
            {
                OccuredInternal++;
            }

            return(seq.ValidatedMinOccurs <= Occured && seq.ValidatedMaxOccurs >= Occured);
        }
        public override bool EvaluateEndElement()
        {
            if (this.seq.ValidatedMinOccurs > base.Occured + 1)
            {
                return(false);
            }
            if (this.seq.CompiledItems.Count == 0)
            {
                return(true);
            }
            if (this.currentAutomata == null && this.seq.ValidatedMinOccurs <= base.Occured)
            {
                return(true);
            }
            int num = (this.current >= 0) ? this.current : 0;
            XsdValidationState xsdValidationState = this.currentAutomata;

            if (xsdValidationState == null)
            {
                xsdValidationState = base.Manager.Create(this.seq.CompiledItems[num] as XmlSchemaParticle);
            }
            while (xsdValidationState != null)
            {
                if (!xsdValidationState.EvaluateEndElement() && !xsdValidationState.EvaluateIsEmptiable())
                {
                    return(false);
                }
                num++;
                if (this.seq.CompiledItems.Count > num)
                {
                    xsdValidationState = base.Manager.Create(this.seq.CompiledItems[num] as XmlSchemaParticle);
                }
                else
                {
                    xsdValidationState = null;
                }
            }
            if (this.current < 0)
            {
                base.OccuredInternal++;
            }
            return(this.seq.ValidatedMinOccurs <= base.Occured && this.seq.ValidatedMaxOccurs >= base.Occured);
        }