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

BuildRefNamespaces() private méthode

private BuildRefNamespaces ( XmlSchema schema ) : void
schema XmlSchema
Résultat void
        private void BuildRefNamespaces(XmlSchema schema) {
            referenceNamespaces = new Hashtable();
            XmlSchemaImport import;
            string ns;

            //Add XSD namespace
            referenceNamespaces.Add(XmlReservedNs.NsXs,XmlReservedNs.NsXs);
            referenceNamespaces.Add(string.Empty, string.Empty);            
            
            foreach(XmlSchemaExternal include in schema.Includes) {
                if(include is XmlSchemaImport) {
                    import = include as XmlSchemaImport;
                    ns = import.Namespace;
                    if(ns != null && referenceNamespaces[ns] == null) 
                      referenceNamespaces.Add(ns,ns);
                }
            }
            
            //Add the schema's targetnamespace 
            if(schema.TargetNamespace != null && referenceNamespaces[schema.TargetNamespace] == null)
                referenceNamespaces.Add(schema.TargetNamespace,schema.TargetNamespace);
           
        }