Esempio n. 1
0
        private XmlSchema Add(string ns, SchemaInfo schemaInfo, XmlSchema schema, bool compile, XmlResolver resolver)
        {
            int errorCount = 0;

            if (schema != null)
            {
                if (schema.ErrorCount == 0 && compile)
                {
                    if (!schema.CompileSchema(this, resolver, schemaInfo, ns, _validationEventHandler, _nameTable, true))
                    {
                        errorCount = 1;
                    }
                    ns = schema.TargetNamespace == null ? string.Empty : schema.TargetNamespace;
                }
                errorCount += schema.ErrorCount;
            }
            else
            {
                errorCount += schemaInfo.ErrorCount;
                //ns = ns == null? string.Empty : NameTable.Add(ns);
                ns = NameTable.Add(ns); //Added without checking for ns == null, since XDR cannot have null namespace
            }
            if (errorCount == 0)
            {
                XmlSchemaCollectionNode node = new XmlSchemaCollectionNode();
                node.NamespaceURI = ns;
                node.SchemaInfo   = schemaInfo;
                node.Schema       = schema;
                Add(ns, node);
                return(schema);
            }
            return(null);
        }
Esempio n. 2
0
        private XmlSchema Add(string ns, SchemaInfo schemaInfo, XmlSchema schema, bool compile, System.Xml.XmlResolver resolver)
        {
            int num = 0;

            if (schema != null)
            {
                if ((schema.ErrorCount == 0) && compile)
                {
                    if (!schema.CompileSchema(this, resolver, schemaInfo, ns, this.validationEventHandler, this.nameTable, true))
                    {
                        num = 1;
                    }
                    ns = (schema.TargetNamespace == null) ? string.Empty : schema.TargetNamespace;
                }
                num += schema.ErrorCount;
            }
            else
            {
                num += schemaInfo.ErrorCount;
                ns   = this.NameTable.Add(ns);
            }
            if (num == 0)
            {
                XmlSchemaCollectionNode node = new XmlSchemaCollectionNode {
                    NamespaceURI = ns,
                    SchemaInfo   = schemaInfo,
                    Schema       = schema
                };
                this.Add(ns, node);
                return(schema);
            }
            return(null);
        }
        private XmlSchema Add(string ns, SchemaInfo schemaInfo, XmlSchema schema, bool compile, XmlResolver resolver) {
            int errorCount = 0;
            if (schema != null) {
                if (schema.ErrorCount == 0 && compile) {
					if (!schema.CompileSchema(this, resolver, schemaInfo, ns, validationEventHandler, nameTable, true)) {
						errorCount = 1;
					}
					ns = schema.TargetNamespace == null ? string.Empty : schema.TargetNamespace;
                }
				errorCount += schema.ErrorCount;
            } 
            else {
                errorCount += schemaInfo.ErrorCount;
                //ns = ns == null? string.Empty : NameTable.Add(ns);
                ns = NameTable.Add(ns); //Added without checking for ns == null, since XDR cannot have null namespace
            }
            if (errorCount == 0) {
                XmlSchemaCollectionNode node = new XmlSchemaCollectionNode();
                node.NamespaceURI = ns;
                node.SchemaInfo = schemaInfo; 
				node.Schema = schema; 
                Add(ns, node);
                return schema;
            }
            return null;
        }
 private XmlSchema Add(string ns, SchemaInfo schemaInfo, XmlSchema schema, bool compile, System.Xml.XmlResolver resolver)
 {
     int num = 0;
     if (schema != null)
     {
         if ((schema.ErrorCount == 0) && compile)
         {
             if (!schema.CompileSchema(this, resolver, schemaInfo, ns, this.validationEventHandler, this.nameTable, true))
             {
                 num = 1;
             }
             ns = (schema.TargetNamespace == null) ? string.Empty : schema.TargetNamespace;
         }
         num += schema.ErrorCount;
     }
     else
     {
         num += schemaInfo.ErrorCount;
         ns = this.NameTable.Add(ns);
     }
     if (num == 0)
     {
         XmlSchemaCollectionNode node = new XmlSchemaCollectionNode {
             NamespaceURI = ns,
             SchemaInfo = schemaInfo,
             Schema = schema
         };
         this.Add(ns, node);
         return schema;
     }
     return null;
 }