SetQualifiedName() private method

private SetQualifiedName ( XmlQualifiedName value ) : void
value XmlQualifiedName
return void
        private void PreprocessIdentityConstraint(XmlSchemaIdentityConstraint constraint) {
            bool valid = true;
            PreprocessAnnotation(constraint); //Set parent of annotation child of key/keyref/unique
            if (constraint.Name != null) {
                ValidateNameAttribute(constraint);
                constraint.SetQualifiedName(new XmlQualifiedName(constraint.Name, this.targetNamespace));
            }
            else {
                SendValidationEvent(Res.Sch_MissRequiredAttribute, "name", constraint);
                valid = false;
            }

            if (rootSchema.IdentityConstraints[constraint.QualifiedName] != null) {
                SendValidationEvent(Res.Sch_DupIdentityConstraint, constraint.QualifiedName.ToString(), constraint);
                valid = false;
            }
            else {
                rootSchema.IdentityConstraints.Add(constraint.QualifiedName, constraint);
            }

            if (constraint.Selector == null) {
                SendValidationEvent(Res.Sch_IdConstraintNoSelector, constraint);
                valid = false;
            }
            if (constraint.Fields.Count == 0) {
                SendValidationEvent(Res.Sch_IdConstraintNoFields, constraint);
                valid = false;
            }
            if (constraint is XmlSchemaKeyref) {
                XmlSchemaKeyref keyref = (XmlSchemaKeyref)constraint;
                if (keyref.Refer.IsEmpty) {
                    SendValidationEvent(Res.Sch_IdConstraintNoRefer, constraint);
                    valid = false;
                }
                else {
                    ValidateQNameAttribute(keyref, "refer", keyref.Refer);
                }
            }
            if (valid) {
                ValidateIdAttribute(constraint);
                ValidateIdAttribute(constraint.Selector);
                SetParent(constraint.Selector, constraint);
                for (int i = 0; i < constraint.Fields.Count; ++i) {
                    SetParent(constraint.Fields[i], constraint);
                    ValidateIdAttribute(constraint.Fields[i]);
                }
            }
        }
 private void PreprocessIdentityConstraint(XmlSchemaIdentityConstraint constraint)
 {
     bool flag = true;
     this.PreprocessAnnotation(constraint);
     if (constraint.Name != null)
     {
         this.ValidateNameAttribute(constraint);
         constraint.SetQualifiedName(new XmlQualifiedName(constraint.Name, this.targetNamespace));
     }
     else
     {
         base.SendValidationEvent("Sch_MissRequiredAttribute", "name", constraint);
         flag = false;
     }
     if (this.rootSchema.IdentityConstraints[constraint.QualifiedName] != null)
     {
         base.SendValidationEvent("Sch_DupIdentityConstraint", constraint.QualifiedName.ToString(), constraint);
         flag = false;
     }
     else
     {
         this.rootSchema.IdentityConstraints.Add(constraint.QualifiedName, constraint);
     }
     if (constraint.Selector == null)
     {
         base.SendValidationEvent("Sch_IdConstraintNoSelector", constraint);
         flag = false;
     }
     if (constraint.Fields.Count == 0)
     {
         base.SendValidationEvent("Sch_IdConstraintNoFields", constraint);
         flag = false;
     }
     if (constraint is XmlSchemaKeyref)
     {
         XmlSchemaKeyref xso = (XmlSchemaKeyref) constraint;
         if (xso.Refer.IsEmpty)
         {
             base.SendValidationEvent("Sch_IdConstraintNoRefer", constraint);
             flag = false;
         }
         else
         {
             this.ValidateQNameAttribute(xso, "refer", xso.Refer);
         }
     }
     if (flag)
     {
         this.ValidateIdAttribute(constraint);
         this.ValidateIdAttribute(constraint.Selector);
         this.SetParent(constraint.Selector, constraint);
         for (int i = 0; i < constraint.Fields.Count; i++)
         {
             this.SetParent(constraint.Fields[i], constraint);
             this.ValidateIdAttribute(constraint.Fields[i]);
         }
     }
 }
Beispiel #3
0
        private void PreprocessIdentityConstraint(XmlSchemaIdentityConstraint constraint) {
            bool valid = true;
            if (constraint.Name != null) {
                ValidateNameAttribute(constraint);
                constraint.SetQualifiedName(new XmlQualifiedName(constraint.Name, this.targetNamespace));
            }
            else {
                SendValidationEvent(Res.Sch_MissRequiredAttribute, "name", constraint);
                valid = false;
            }

            if (this.identityConstraints[constraint.QualifiedName] != null) {
                SendValidationEvent(Res.Sch_DupIdentityConstraint, constraint.QualifiedName.ToString(), constraint);
                valid = false;
            }
            else {
                this.identityConstraints.Add(constraint.QualifiedName, constraint);
            }

            if (constraint.Selector == null) {
                SendValidationEvent(Res.Sch_IdConstraintNoSelector, constraint);
                valid = false;
            }
            if (constraint.Fields.Count == 0) {
                SendValidationEvent(Res.Sch_IdConstraintNoFields, constraint);
                valid = false;
            }
            if (constraint is XmlSchemaKeyref) {
                XmlSchemaKeyref keyref = (XmlSchemaKeyref)constraint;
                if (keyref.Refer.IsEmpty) {
                    SendValidationEvent(Res.Sch_IdConstraintNoRefer, constraint);
                    valid = false;
                }
                else {
                    ValidateQNameAttribute(keyref, "refer", keyref.Refer);
                }
            }
            if (valid) {
                ValidateIdAttribute(constraint);
                ValidateIdAttribute(constraint.Selector);
                foreach (XmlSchemaXPath field in constraint.Fields) {
                    ValidateIdAttribute(field);
                }
            }
        }