Beispiel #1
0
        private void LoadDefinitionLinkbase( Dimension d, string linkbase, out int numErrors )
        {
            numErrors = 0;

            string baseUri = GetTargetNamespace();

            if ( baseUri[baseUri.Length - 1] != '/' && baseUri[baseUri.Length - 1] != '\\' )
            {
                baseUri += "/";
            }
            string bs = baseUri + schemaFilename;

            Dictionary<string, string> discoveredSchemas = new Dictionary<string, string>();

            if ( linkbase.StartsWith( "http" ) )
            {
                baseUri = linkbase.Replace( Path.GetFileName( linkbase ), string.Empty );
            }

            d.BaseSchema = bs;
            d.OwnerHandle = OwnerHandle;
            d.Load( linkbase );
            if (IsAucentExtension && skipAucentExtensions && !this.innerTaxonomy &&
                d.IsDocumentCreatedByRivet())
            {
                //if this is a top level aucent extension taxonomy and ...
                //if the skipAucentExtensions is set to true ... we want to load just the no rivet created files...
                //as we will merge the rivet created files later....
                return;
            }
            if ( d.ErrorList.Count > 0 )
            {
                for ( int i = 0; i < d.ErrorList.Count; i++ )
                    Common.WriteError( "XBRLParser.Error.Exception", validationErrors,
                        SchemaFile + ": DEFINITION_ROLE Error: " + d.ErrorList[i] );
            }

            d.Parse( discoveredSchemas,
                out numErrors );

            foreach ( string val in discoveredSchemas.Values )
            {
                string filename = Path.GetFileName( val );
                string hintPath = val.Replace(filename, string.Empty);

                LoadAdditionalDependantTaxonomy(filename, hintPath, ref  numErrors);

            }
        }