System.Xml.Schema.SchemaCollectionPreprocessor.Execute C# (CSharp) Méthode

Execute() public méthode

public Execute ( XmlSchema schema, string targetNamespace, bool loadExternals, XmlSchemaCollection xsc ) : bool
schema XmlSchema
targetNamespace string
loadExternals bool
xsc XmlSchemaCollection
Résultat bool
        public bool Execute(XmlSchema schema, string targetNamespace, bool loadExternals, XmlSchemaCollection xsc) {
            this.schema = schema;
            Xmlns = NameTable.Add("xmlns");

            Cleanup(schema);
            if (loadExternals && xmlResolver != null) {
                schemaLocations = new Hashtable(); //new Dictionary<Uri, Uri>();
                if (schema.BaseUri != null) {
                    schemaLocations.Add(schema.BaseUri, schema.BaseUri);
                }
                LoadExternals(schema, xsc);
            }
            ValidateIdAttribute(schema);
            Preprocess(schema, targetNamespace, Compositor.Root);
            if (!HasErrors) {
                schema.IsPreprocessed = true;
                foreach(XmlSchemaExternal include in schema.Includes) {
                    if (include.Schema != null) {
                        include.Schema.IsPreprocessed = true;
                    }
                }
            }
            return !HasErrors;
        }

Usage Example

 internal bool CompileSchema(XmlSchemaCollection xsc, XmlResolver resolver, SchemaInfo schemaInfo, string ns, ValidationEventHandler validationEventHandler, XmlNameTable nameTable, bool CompileContentModel)
 {
     lock (this)
     {
         SchemaCollectionPreprocessor preprocessor = new SchemaCollectionPreprocessor(nameTable, null, validationEventHandler) {
             XmlResolver = resolver
         };
         if (!preprocessor.Execute(this, ns, true, xsc))
         {
             return false;
         }
         this.isCompiled = new SchemaCollectionCompiler(nameTable, validationEventHandler).Execute(this, schemaInfo, CompileContentModel);
         this.SetIsCompiled(this.isCompiled);
         return this.isCompiled;
     }
 }
All Usage Examples Of System.Xml.Schema.SchemaCollectionPreprocessor::Execute