コード例 #1
0
        private void LoadSchema(string uri, string url)
        {
            if (this.XmlResolver == null)
            {
                return;
            }
            if (SchemaInfo.TargetNamespaces.ContainsKey(uri) && nsManager.LookupPrefix(uri) != null)
            {
                return;
            }

            SchemaInfo schemaInfo = null;

            if (SchemaCollection != null)
            {
                schemaInfo = SchemaCollection.GetSchemaInfo(uri);
            }
            if (schemaInfo != null)
            {
                if (schemaInfo.SchemaType != SchemaType.XSD)
                {
                    throw new XmlException(Res.Xml_MultipleValidaitonTypes, string.Empty, this.PositionInfo.LineNumber, this.PositionInfo.LinePosition);
                }
                SchemaInfo.Add(schemaInfo, EventHandler);
                return;
            }
            if (url != null)
            {
                LoadSchemaFromLocation(uri, url);
            }
        }
コード例 #2
0
ファイル: XdrValidator.cs プロジェクト: mikem8361/runtime
        private void LoadSchema(string uri)
        {
            if (this.schemaInfo !.TargetNamespaces.ContainsKey(uri))
            {
                return;
            }
            if (this.XmlResolver == null)
            {
                return;
            }

            SchemaInfo?schemaInfo = null;

            if (SchemaCollection != null)
            {
                schemaInfo = SchemaCollection.GetSchemaInfo(uri);
            }

            if (schemaInfo != null)
            {
                if (schemaInfo.SchemaType != SchemaType.XDR)
                {
                    throw new XmlException(SR.Xml_MultipleValidationTypes, string.Empty, this.PositionInfo.LineNumber, this.PositionInfo.LinePosition);
                }

                this.schemaInfo.Add(schemaInfo, EventHandler);
                return;
            }

            LoadSchemaFromLocation(uri);
        }