Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to attach label for a fact ? #5

Closed
ValeriyTitov opened this issue Mar 28, 2018 · 9 comments
Closed

How to attach label for a fact ? #5

ValeriyTitov opened this issue Mar 28, 2018 · 9 comments
Assignees
Labels
Q&A Questions and answers. sample requested

Comments

@ValeriyTitov
Copy link

How to find human-friendly name for a fact ?
Can you provide an example ?

@JeffFerguson
Copy link
Owner

The FactCollection class has methods like GetFactByName() and GetFactsByName(). Would those help? The FactCollection is available from an XbrlFragment, so the code would look something like this:

var xbrlDoc = new XbrlDocument();
xbrlDoc.Load("MyFile.xml");
var firstFragment = xbrlDoc.XbrlFragments[0];
var singleFact = firstFragment.Facts.GetFactByName("FactToFind");

or

var xbrlDoc = new XbrlDocument();
xbrlDoc.Load("MyFile.xml");
var firstFragment = xbrlDoc.XbrlFragments[0];
var allFactsMatchingName = firstFragment.Facts.GetFactsByName("FactToFind");

Does that help?

@JeffFerguson JeffFerguson added the Q&A Questions and answers. label Mar 28, 2018
@ValeriyTitov
Copy link
Author

I mean label for a fact, not its name.
I don't understand how find Label for a fact in LabelLinkbase

@JeffFerguson
Copy link
Owner

Let me make sure that I understand what you're asking. I'd like to understand your need a bit more. Are you saying that ...

  • for each label in a label linkbase, you want to find the fact for the label?

or

  • for each fact in the document, find its label?

@JeffFerguson JeffFerguson self-assigned this Mar 28, 2018
@ValeriyTitov
Copy link
Author

ValeriyTitov commented Mar 28, 2018

The second one.

for each fact in the document, find its label?

For each fact, find its label with specific language(culture)

@JeffFerguson
Copy link
Owner

Let me think on that one a bit and get back to you. I'll come back with some sample code. Is there a specific XBRL document out on the Internet that you're working with? If there is, and you can send me the URL, I can use it in the example.

@ValeriyTitov
Copy link
Author

Sure, but instance-file is useless without taxonomy.
Accountants List.zip

Taxonomy is located at Russian Central Bank

However, it local taxonomy.
I've overrided your XbrlSchema.GetFullSchemaPath with this ugly code just to make sure Gepsio able to load instance document.

string RealFileName;
                RealFileName = System.IO.Path.GetFileName(SchemaFilename);
                 if (RealFileName.Equals("ep_nso_purcb_m_q_30d.xsd", StringComparison.OrdinalIgnoreCase))
                {
                    FullPath = @"C:\Tax\www.cbr.ru\xbrl\nso\purcb\rep\2018-02-28\ep\ep_nso_purcb_m_q_30d.xsd";
                    return FullPath;
                }

I'm planning to use XmlUrlResolver next:)

@ValeriyTitov
Copy link
Author

ValeriyTitov commented Mar 28, 2018

Most of labels will require cyrillic font. They probably look like chinese to you :)

@JeffFerguson
Copy link
Owner

Thank you! I will take a look at this and get back to you.

@JeffFerguson
Copy link
Owner

There is a sample available in Issue 12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Q&A Questions and answers. sample requested
Projects
None yet
Development

No branches or pull requests

2 participants