Class XbrlParser
Top-level XBRL parser coordinating DTS loading and parsing of schema, instance and linkbase documents. Use ParseAsync(Uri, Func<Uri, Task<XDocument>>) to parse an entry point and produce a DiscoverableTaxonomySet.
public class XbrlParser : IXbrlParser
- Inheritance
-
XbrlParser
- Implements
- Derived
- Inherited Members
Constructors
XbrlParser(ILoggerFactory?)
Initializes a new instance of the XbrlParser class.
public XbrlParser(ILoggerFactory? loggerFactory)
Parameters
loggerFactoryILoggerFactoryOptional logger factory for diagnostic logging. If null, a NullLoggerFactory is used.
Fields
DefaultLoaderFunc
Default loader function used to fetch an XDocument for a given Uri. This can be overridden by supplying a custom loader to ParseAsync(Uri, Func<Uri, Task<XDocument>>).
public static Func<Uri, Task<XDocument>> DefaultLoaderFunc
Field Value
_logger
Provides logging capabilities for the XBRLDiscoverableTaxonomySet class.
protected readonly ILogger<DiscoverableTaxonomySet> _logger
Field Value
Remarks
Intended for use within the class and its derived types to record diagnostic and operational information. The logger instance is initialized externally and should not be modified after construction.
Methods
LoadDtsAsync(Uri, Func<Uri, Task<XDocument>>)
Asynchronously loads an XBRL Discoverable Taxonomy Set (DTS) from the specified entry point URI using the provided document loader.
protected Task<DiscoverableTaxonomySet> LoadDtsAsync(Uri entryPointUri, Func<Uri, Task<XDocument>> loader)
Parameters
entryPointUriUriThe URI of the entry point document for the taxonomy set. This must be a valid, absolute URI identifying the root of the DTS to load.
loaderFunc<Uri, Task<XDocument>>A delegate that asynchronously loads an XML document given its URI. The function should return a task that produces the loaded XDocument.
Returns
- Task<DiscoverableTaxonomySet>
A task that represents the asynchronous operation. The task result contains the loaded XBRLDiscoverableTaxonomySet instance.
Parse(DiscoverableTaxonomySet)
Parses the specified XBRL discoverable taxonomy set, including its schema, instance, and linkbase components, and resolves associated labels, references, and generic links.
protected void Parse(DiscoverableTaxonomySet dts)
Parameters
dtsDiscoverableTaxonomySetThe discoverable taxonomy set to parse. Must not be null.
Remarks
This method processes the provided taxonomy set by invoking specialized parsers for each XBRL component and then resolves additional relationships such as labels, references, and generic links. The method is intended to be called as part of a larger XBRL processing workflow and assumes that the input taxonomy set is valid and fully loaded.
ParseAsync(Uri, Func<Uri, Task<XDocument>>)
Parse XBRL documents starting from the specified entry point URI and using the provided loader to fetch documents. The resulting DiscoverableTaxonomySet contains discovered elements, contexts, units, facts and links.
public virtual Task<DiscoverableTaxonomySet> ParseAsync(Uri entryPointUri, Func<Uri, Task<XDocument>> loader)
Parameters
entryPointUriUriURI of the initial XBRL entry document (instance or schema).
loaderFunc<Uri, Task<XDocument>>
Returns
- Task<DiscoverableTaxonomySet>
A task that represents the asynchronous parse operation. The task result is the populated DiscoverableTaxonomySet.