Пример #1
0
        public bool LoadImport(XmlNode node, XbrlTaxonomyDocument taxonomydocument)
        {
            var result    = true;
            var paths     = Xml.Attr(node, schemalocationattributeselector);
            var pathitems = paths.Split(' ');

            if (taxonomydocument.FileName == "dim-def.xml")
            {
            }

            foreach (var path in pathitems)
            {
                if (Utilities.Strings.IsXMLFile(path))
                {
                    //if (!(path.EndsWith(".xml") || path.EndsWith(".xsd")))
                    //{

                    //}
                    AddRelativeReferencedFiles(path);
                }
            }
            //AddRelativeReferencedFiles(path);

            return(result);
        }
Пример #2
0
        public bool LoadLink(XmlNode node, XbrlTaxonomyDocument taxonomydocument)
        {
            var result   = true;
            var linkpath = Xml.Attr(node, xlinkrefattributeselector);

            AddRelativeReferencedFiles(linkpath);

            return(result);
        }
Пример #3
0
        public void LoadTaxonomyDocument(string path)
        {
            //remove hash

            if (path.Contains("#"))
            {
                path = path.Remove(path.IndexOf("#"));
            }

            var loaded = _LoadedSourcePathes.FirstOrDefault(i => i == path);

            if (loaded == null)
            {
                _LoadedSourcePathes.Add(path);


                var fullpath = path;
                //var taxonomydocument = Engine.CurrentEngine.TaxonomyDocuments.FirstOrDefault(i => i.SourcePath == path);


                var sourcepath = path;
                if (Utilities.Strings.IsRelativePath(sourcepath))
                {
                    sourcepath = Utilities.Strings.ResolveRelativePath(SourceFolder, path);
                }
                var localpath    = Utilities.Strings.GetLocalPath(XbrlEngine.LocalFolder, sourcepath);
                var localrelpath = Utilities.Strings.GetRelativePath(LogicalModel.TaxonomyEngine.LocalFolder, localpath);
                //Logger.WriteLine(localpath);

                var taxonomydocument = Taxonomy.FindDocument(localrelpath);
                if (taxonomydocument == null)
                {
                    //Logger.WriteLine(path);
                    taxonomydocument = new XbrlTaxonomyDocument(path, this);
                    Taxonomy.AddTaxonomyDocument(taxonomydocument);
                    taxonomydocument.LoadReferences();
                }
                //var reference = References.FirstOrDefault(i => i.SourcePath == path);
                var reference = References.FirstOrDefault(i => i.LocalRelPath == localrelpath);
                if (reference == null)
                {
                    References.Add(taxonomydocument);
                    ReferencedFiles.Add(taxonomydocument.LocalRelPath);
                }
            }
        }
Пример #4
0
        public bool LoadTaxonomyDocument(string filepath, XbrlTaxonomyDocument parent)
        {
            //if (filepath.Contains("header-rend.xml"))
            //{

            //}
            var result = true;

            MarkupPath = filepath;
            var sourcepath = filepath;

            if (parent != null)
            {
                if (Utilities.Strings.IsRelativePath(MarkupPath))
                {
                    sourcepath = Utilities.Strings.ResolveRelativePath(parent.SourceFolder, MarkupPath);
                }
            }

            var localpath = Utilities.Strings.GetLocalPath(XbrlEngine.LocalFolder, sourcepath);

            SetLocalPath(localpath);
            SetSourcePath(sourcepath);
            //moved to FileManager.cs
            try
            {
                Utilities.Strings.CopyToLocal(sourcepath, localpath, false);
                LoadDocument();
                XbrlTaxonomy.SetTargetNamespace(this);
            }
            catch (Exception ex)
            {
                Logger.WriteLine(String.Format("Can't get source file {0}. Error: {1}", sourcepath, ex));
                result = false;
            }


            return(result);
        }
Пример #5
0
 public XbrlTaxonomyDocument(string filepath, XbrlTaxonomyDocument parent)
 {
     this.Taxonomy = parent.Taxonomy;
     AddHandlers();
     LoadTaxonomyDocument(filepath, parent);
 }