...
Tagging of XHTML Documents to generate Inline XBRL Instances
The class InlineXbrlInstanceGenerator class InlineXBRLInstanceGenerator can be used to generate InlineXbrlDocuments InlineXBRLDocuments, which means applying it adds XBRL Tags to existing XHTML document. The XBRL Engine does not contain any include the XHTML editor. In order to instantiate generate an InlineXbrlInstanceGenerator InlineXBRLInstanceGenerator, a Processor processor object as well as the XbrlTaxonomy XBRLTaxonomy is required. Any XmlDocument class object can be used to apply tags to it. It is important , that the XHTML document is complient to its iXBRL XHTML schemascheme. In the following examples, a small-inline.docx.xhtml file is used.
Code Block | ||||
---|---|---|---|---|
| ||||
Processor processor = new Processor(); XbrlTaxonomy taxonomy = processor .ReadXbrlTaxonomy("http://xbrl.ifrs.org/taxonomy/2017-03-09/full_ifrs_mc_doc_entry_point_2017-03-09.xsd"); XmlDocument document = new XmlDocument(); document.Load("small-inline.docx.xhtml"); InlineXbrlInstanceGenerator inlineGenerator = new InlineXbrlInstanceGenerator(processor, document, new List<XbrlTaxonomy> { taxonomy }); |
Tag Inline Facts
agging of To tag numbers and texts in XHTML document, the appropriate XmlElement must be selected either with XPath or any other way, then . After that the iXBRL Tag can be applied to it. Optionally, the method TagNonFractionItem() accepts a format parameters as XmlQualifiedName, that must match the formats defined in the transformation registries, in order to be tagged correctly. Internally, the XBRL Engine uses the InlineXbrlValueTransformer class to transform values. It offers public methods to test the transformation of values.
...
The XBRL Engine offers methods to insert footnotes to existing facts. This is can be done by tagging the footnote itself, and then adding an a relationship between the footnote and an unlimited numbers if of facts (continuing the example from above):
...
Converting and Validating Inline XBRL Documents
InlineXbrlDocuments InlineXBRLDocuments can be validated like by calling nameing the validate method. , Keep in mind , that the XHTML validaton is loading the full XML Schemascheme, which might take some time if not already existing in the XBRL Cache folder.
Code Block | ||||
---|---|---|---|---|
| ||||
// First, all XML documents of one iXBRL report have to be loaded into a list: List<XmlDocument> instanceDocs = new List<XmlDocument>(); foreach (string instance in Directory.GetFiles(@"C:\xbrlReport", "*.xhtml")) { XmlDocument xmlDocument = new XmlDocument(Processor.NameTable) { PreserveWhitespace = true }; xmlDocument.Load(instance); instanceDocs.Add(xmlDocument); } InlineXbrlDocument inlineDoc = InlineXbrlDocument.Load(Processor, instanceDocs); // Validate iXBRL 1.1 inlineDoc.Validate(validateXbrlTaxonomies: false, attachResultsToFacts: true); // Validate XHTML inlineDoc.ValidateXhtml(attachResultsToFacts: true); // Writing validation results to console output: foreach (IValidationResult result in inlineDoc.DocumentResultSet.GetItems()) { Console.WriteLine(result.Message); } |
To convert InlineXbrlDocuments InlineXBRLDocuments to normal XbrlDocuments XBRLDocuments and to perform Formula validation , the ConvertToXbrlDocumentscan be used, that returns of the formulas the ConvertToXBRLDocuments can be used. All it takes it the return a dictionary of Dictionary<string, XbrlDocument>, where the string represents the target document (in case of default target documents, its an empty string):
...
For more information about the validation of XbrlDocuments XBRLDocuments, see chapter above.
Create or Extend Taxonomies
Some reporting requirements, like ESEF and SEC reporting, require to extend a taxonomy. Reports for those requirements use a custom taxonomy, which is based on another taxonomy (like IFRS taxonomy). This means that the elements from the base taxonomy can be used, but the custom taxonomy can also define additional elements which are reported published in the report. Using With the AMANA XBRL Engine , it is possible to generate such a taxonomy extension.
According to the ESEF, reporting requirement extension elements must also be anchored. This means that extension elements must be linked to an existing element of the ESEF taxonomy. Those anchors can also be generated using the AMANA XBRL Engine.
The namespace AMANA.XBRL.Engine.TaxonomyCreator contains classes for generating taxonomy extensions. The general process of for creating a taxonomy extension is:
- Use the TaxonomyExtensionBuilder to create a XbrlTaxonomy object in memory and add all extension elements to the taxonomy.
- Use the TaxonomyCreator to save the XbrlTaxonomy object as XML files.
...