xbrlens

    XBRLens is a MoonBit XBRL 2.1 and XBRL Dimensions implementation with tuple, footnote and precision-aware calculation support.

    xbrl
    financial-reporting
    taxonomy
    validation
    Download zip
    Version
    0.3.0
    License
    Apache-2.0
    Last updated
    39 minutes ago
    Downloads
    44

    No dependencies

    #XBRLens

    XBRLens is a MoonBit-native XBRL 2.1 parsing and validation engine. It is intended for financial filing ingestion, taxonomy-aware fact normalization, XBRL Dimensions handling and calculation relationship checks.

    #Features

    • Bounded, namespace-aware XML parser with DTD/entity rejection
    • XBRL contexts, periods, entities, units, item facts and nested tuple facts
    • Footnote links, roleRef and arcroleRef parsing
    • Exact arbitrary-precision decimal arithmetic
    • Taxonomy schema parsing for concepts, imports and role types
    • Offline taxonomy catalog and import resolution
    • Label, presentation and calculation linkbases
    • XBRL Dimensions 1.0 explicit and typed members
    • Weighted calculation validation
    • Duplicate, conflict and integrity diagnostics
    • JSON and CSV fact export
    • CLI workflows and inspectable security audits
    • wasm, wasm-gc and JavaScript test coverage

    #Install

    moon add ggbond44439/xbrlens@0.3.0

    The current Mooncakes release is 0.3.0. The library requires MoonBit moonc >= 0.10.16 and has no native runtime dependency.

    #Usage

    let instance = match @xbrlens.parse_instance_xml(source, @xbrlens.XbrlLimits::strict()) {
    Ok(value) => value
    Err(err) => abort(err.to_string())
    }

    let facts_json = match @xbrlens.export_json(instance) {
    Ok(value) => value
    Err(err) => abort(err.to_string())
    }

    The source argument is an XBRL instance XML string. The parser rejects unsafe declarations, external entities, invalid control characters, malformed namespaces and inputs exceeding configured limits.

    #CLI

    moon run cmd/main -- inspect '<instance-xml>' moon run cmd/main -- facts '<instance-xml>' moon run cmd/main -- facts --csv '<instance-xml>' moon run cmd/main -- validate '<instance-xml>' moon run cmd/main -- calc '<instance-xml>' '<taxonomy-xml>' '<linkbase-xml>' moon run cmd/main -- diff '<left-instance-xml>' '<right-instance-xml>'

    #Examples and fixtures

    The representative fixture in fixtures/sample/ contains an instance, taxonomy and calculation linkbase covering duration/instant contexts, a monetary unit, an explicit dimension and a weighted calculation.

    moon run examples/smoke moon run cmd/main -- calc "$(cat fixtures/sample/instance.xml)" "$(cat fixtures/sample/taxonomy.xsd)" "$(cat fixtures/sample/calculation.xml)"

    Run independent XML-parser differential checking and the repeatable CLI benchmark:

    python scripts/differential_check.py python scripts/benchmark.py --iterations 3

    #Verification

    moon check --target all moon test --target wasm moon test --target wasm-gc moon test --target js moon fmt --check

    #XBRL 2.1 conformance target

    The project target is complete conformance to the XBRL 2.1 base specification and XBRL Dimensions 1.0. The bounded parser is a security and resource-control layer, not the conformance boundary. No standard-defined behavior such as tuple facts or footnote links is permanently excluded from the target.

    The implementation is organized into explicit delivery phases:

    1. Current baseline: bounded XML parsing; QName and namespace handling; instances, contexts, periods, units and item facts; item and nested tuple facts; label, presentation, calculation and footnote linkbases; roleRef and arcroleRef; XBRL Dimensions 1.0 explicit and typed members; precision-aware calculation checks; integrity diagnostics; JSON/CSV export and CLI.
    2. DX/DTS phase: complete XML Schema and XLink conformance relevant to XBRL, xsi:nil and xsi:type validation, substitution-group and type derivation semantics, full DTS discovery through offline catalogs, import/redefine/include handling and linkbase role resolution.
    3. Instance semantics phase: complete tuple content models, tuple/item identity and consistency rules, footnote and locator edge cases, context aspect equivalence, unit equivalence and all duplicate-fact consistency rules required by the base specification.
    4. Conformance phase: run the official XBRL 2.1 and XBRL Dimensions conformance suites, track every test failure explicitly, and require the complete suite to pass before declaring full conformance. Compatibility fixtures and negative tests remain in CI.
    5. Adjacent specifications: XBRL Formula, Transformation and Generic Link are separate specifications and are not used to redefine the XBRL 2.1 base target. They can be added as explicitly scoped extensions after the base conformance suite passes.

    The current release is therefore a standards-targeted implementation in progress, not a claim that every conformance-suite case already passes.

    #Calculation decision mechanism

    Calculation checks do not compare rounded lexical values by exact string equality. For each numeric fact, the engine derives an accuracy half-unit from decimals, or from significant digits and magnitude when precision is supplied:

    • decimals="2" means a half-unit of 0.005;
    • decimals="-6" means a half-unit of 500000;
    • precision="3" uses the fact magnitude and significant-digit position;
    • decimals="INF" is treated as exact.

    Child values and their weighted uncertainty are accumulated with exact decimal arithmetic. The resulting expected interval and the parent fact interval are compared for overlap. A missing accuracy indicator on a numeric calculation fact is rejected rather than assumed exact.

    Facts are matched by semantic context and unit signatures, not only by contextRef or unitRef strings. Context signatures include entity, period, segment/scenario content and dimensional content. Unit signatures include normalized measure sets, including divide numerators and denominators. This prevents a calculation from being considered reliable merely because two references share an identifier-like lexical form.

    Example: a parent fact of 5,400,000 with decimals="-6" and children 2,000,000 and 3,000,000, each with decimals="-6", produces overlapping expected and reported intervals and is accepted. A parent of 7,000,000 with the same children is outside the expected interval and is reported as a mismatch. The executable fixture is fixtures/sample/rounded_instance.xml.

    #Security

    Parsing is bounded by configurable source, XML depth, node, attribute, text, fact and linkbase-arc limits. DTDs and external entities are rejected, as are invalid XML control characters and raw ]]> text. Use audit_instance_source to obtain a bounded input audit summary.

    #License

    Apache-2.0

    ArcUse

    pub(all) enum ArcUse {
    Optional
    Prohibited
    Unspecified
    } derive(Eq,
    Debug
    )

    ArcUse::equal

    fn ArcUse::equal(ArcUse, ArcUse) -> Bool
    automatically derived

    ArcUse::not_equal

    fn ArcUse::not_equal(x : ArcUse, y : ArcUse) -> Bool
    automatically derived

    ArcUse::to_repr

    automatically derived

    ArcroleRef

    pub(all) struct ArcroleRef {
    arcrole_uri : String
    href : String
    offset : Int
    } derive(Eq,
    Debug
    )

    ArcroleRef::equal

    fn ArcroleRef::equal(ArcroleRef, ArcroleRef) -> Bool
    automatically derived

    ArcroleRef::not_equal

    fn ArcroleRef::not_equal(x : ArcroleRef, y : ArcroleRef) -> Bool
    automatically derived

    ArcroleRef::to_repr

    automatically derived

    CalculationCheck

    pub(all) struct CalculationCheck {
    role_uri : String
    parent : QName
    context_ref : String
    expected : Decimal
    expected_low : Decimal
    expected_high : Decimal
    actual : Decimal
    actual_low : Decimal
    actual_high : Decimal
    matched : Bool
    child_count : Int
    } derive(Eq,
    Debug
    )

    CalculationCheck::equal

    automatically derived

    CalculationCheck::not_equal

    fn CalculationCheck::not_equal(x : CalculationCheck, y : CalculationCheck) -> Bool
    automatically derived

    CalculationCheck::to_repr

    automatically derived

    CalculationGroup

    pub(all) struct CalculationGroup {
    role_uri : String
    parent : QName
    relations : Array[CalculationRelation]
    } derive(Eq,
    Debug
    )

    CalculationGroup::equal

    automatically derived

    CalculationGroup::not_equal

    fn CalculationGroup::not_equal(x : CalculationGroup, y : CalculationGroup) -> Bool
    automatically derived

    CalculationGroup::to_repr

    automatically derived
    pub(all) struct CalculationLink {
    role_uri : String
    locators : Array[LinkLocator]
    arcs : Array[LinkArc]
    offset : Int
    } derive(Eq,
    Debug
    )

    CalculationLink::equal

    automatically derived

    CalculationLink::not_equal

    fn CalculationLink::not_equal(x : CalculationLink, y : CalculationLink) -> Bool
    automatically derived

    CalculationLink::to_repr

    automatically derived

    CalculationRelation

    pub(all) struct CalculationRelation {
    link_role_uri : String
    parent : QName
    child : QName
    weight : Decimal
    order : Decimal?
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    CalculationRelation::equal

    automatically derived

    CalculationRelation::not_equal

    automatically derived

    CalculationRelation::to_repr

    automatically derived

    CalculationReport

    pub(all) struct CalculationReport {
    checks : Array[CalculationCheck]
    } derive(Eq,
    Debug
    )

    CalculationReport::equal

    automatically derived

    CalculationReport::is_valid

    fn CalculationReport::is_valid(self : CalculationReport) -> Bool

    CalculationReport::mismatches

    CalculationReport::not_equal

    fn CalculationReport::not_equal(x : CalculationReport, y : CalculationReport) -> Bool
    automatically derived

    CalculationReport::to_repr

    automatically derived

    CliCommand

    pub(all) enum CliCommand {
    Help
    Version
    Inspect
    Facts
    Validate
    Calc
    Diff
    } derive(Eq,
    Debug
    )

    CliCommand::equal

    fn CliCommand::equal(CliCommand, CliCommand) -> Bool
    automatically derived

    CliCommand::not_equal

    fn CliCommand::not_equal(x : CliCommand, y : CliCommand) -> Bool
    automatically derived

    CliCommand::to_repr

    automatically derived

    CliError

    pub(all) enum CliError {
    UnknownCommand(String)
    UnknownOption(String)
    MissingArgument(String)
    } derive(Eq,
    Debug
    )

    impl Show for CliError

    CliError::equal

    fn CliError::equal(CliError, CliError) -> Bool
    automatically derived

    CliError::not_equal

    fn CliError::not_equal(x : CliError, y : CliError) -> Bool
    automatically derived

    CliError::output

    fn CliError::output(self : CliError, logger : &Logger) -> Unit

    CliError::to_repr

    automatically derived

    CliError::to_string

    fn CliError::to_string(self : CliError) -> String

    Default implementation for Show::to_string, uses a StringBuilder

    CliInvocation

    pub(all) struct CliInvocation {
    command : CliCommand
    args : Array[String]
    json : Bool
    csv : Bool
    help : Bool
    } derive(Eq,
    Debug
    )

    CliInvocation::equal

    automatically derived

    CliInvocation::not_equal

    fn CliInvocation::not_equal(x : CliInvocation, y : CliInvocation) -> Bool
    automatically derived

    CliInvocation::to_repr

    automatically derived

    CliResult

    pub(all) struct CliResult {
    exit_code : Int
    stdout : String
    stderr : String
    } derive(Eq,
    Debug
    )

    CliResult::equal

    fn CliResult::equal(CliResult, CliResult) -> Bool
    automatically derived

    CliResult::failure

    fn CliResult::failure(code : Int, stderr : String) -> CliResult

    CliResult::not_equal

    fn CliResult::not_equal(x : CliResult, y : CliResult) -> Bool
    automatically derived

    CliResult::success

    fn CliResult::success(stdout : String) -> CliResult

    CliResult::to_repr

    automatically derived

    ConceptBalance

    pub(all) enum ConceptBalance {
    Debit
    Credit
    Unspecified
    } derive(Eq,
    Debug
    )

    ConceptBalance::equal

    automatically derived

    ConceptBalance::not_equal

    fn ConceptBalance::not_equal(x : ConceptBalance, y : ConceptBalance) -> Bool
    automatically derived

    ConceptBalance::to_repr

    automatically derived

    ConceptKind

    pub(all) enum ConceptKind {
    Item
    Tuple
    } derive(Eq,
    Debug
    )

    ConceptKind::equal

    fn ConceptKind::equal(ConceptKind, ConceptKind) -> Bool
    automatically derived

    ConceptKind::not_equal

    fn ConceptKind::not_equal(x : ConceptKind, y : ConceptKind) -> Bool
    automatically derived

    ConceptKind::to_repr

    automatically derived

    ConceptLabel

    pub(all) struct ConceptLabel {
    concept : QName
    link_role_uri : String
    label_role_uri : String
    language : String?
    text : String
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    ConceptLabel::equal

    automatically derived

    ConceptLabel::not_equal

    fn ConceptLabel::not_equal(x : ConceptLabel, y : ConceptLabel) -> Bool
    automatically derived

    ConceptLabel::to_repr

    automatically derived

    ConceptPeriodType

    pub(all) enum ConceptPeriodType {
    Instant
    Duration
    Unspecified
    } derive(Eq,
    Debug
    )

    ConceptPeriodType::equal

    automatically derived

    ConceptPeriodType::not_equal

    fn ConceptPeriodType::not_equal(x : ConceptPeriodType, y : ConceptPeriodType) -> Bool
    automatically derived

    ConceptPeriodType::to_repr

    automatically derived

    Decimal

    pub(all) struct Decimal {
    coefficient :
    BigInt

    scale : Int
    } derive(Eq,
    Debug
    )

    Decimal::add

    fn Decimal::add(self : Decimal, other : Decimal, offset : Int) -> Result[Decimal, XbrlError]

    Decimal::compare

    fn Decimal::compare(self : Decimal, other : Decimal) -> Int

    Decimal::equal

    fn Decimal::equal(Decimal, Decimal) -> Bool
    automatically derived

    Decimal::is_zero

    fn Decimal::is_zero(self : Decimal) -> Bool

    Decimal::mul

    fn Decimal::mul(self : Decimal, other : Decimal, offset : Int) -> Result[Decimal, XbrlError]

    Decimal::neg

    fn Decimal::neg(self : Decimal) -> Decimal

    Decimal::normalize

    fn Decimal::normalize(self : Decimal) -> Decimal

    Decimal::not_equal

    fn Decimal::not_equal(x : Decimal, y : Decimal) -> Bool
    automatically derived

    Decimal::parse

    fn Decimal::parse(value : StringView) -> Result[Decimal, XbrlError]

    Decimal::sub

    fn Decimal::sub(self : Decimal, other : Decimal, offset : Int) -> Result[Decimal, XbrlError]

    Decimal::to_canonical_string

    fn Decimal::to_canonical_string(self : Decimal) -> String

    Decimal::to_repr

    automatically derived

    Decimal::to_scaled_integer

    fn Decimal::to_scaled_integer(self : Decimal, scale : Int) -> Result[
    BigInt
    , XbrlError]

    Decimal::zero

    fn Decimal::zero() -> Decimal

    DimensionMember

    pub(all) enum DimensionMember {
    Explicit(QName, QName)
    Typed(QName, QName, String)
    } derive(Eq,
    Debug
    )

    DimensionMember::dimension

    fn DimensionMember::dimension(self : DimensionMember) -> QName

    DimensionMember::equal

    automatically derived

    DimensionMember::not_equal

    fn DimensionMember::not_equal(x : DimensionMember, y : DimensionMember) -> Bool
    automatically derived

    DimensionMember::to_repr

    automatically derived

    FactDiagnostic

    pub(all) struct FactDiagnostic {
    kind : FactDiagnosticKind
    severity : FactDiagnosticSeverity
    concept : QName
    context_ref : String
    unit_ref : String?
    fact_ids : Array[String]
    message : String
    offset : Int
    } derive(Eq,
    Debug
    )

    FactDiagnostic::equal

    automatically derived

    FactDiagnostic::not_equal

    fn FactDiagnostic::not_equal(x : FactDiagnostic, y : FactDiagnostic) -> Bool
    automatically derived

    FactDiagnostic::to_repr

    automatically derived

    FactDiagnosticKind

    pub(all) enum FactDiagnosticKind {
    ExactDuplicate
    ConflictingDuplicate
    NilConflict
    MultipleUnits
    DecimalsPrecisionConflict
    InvalidDecimals
    InvalidPrecision
    } derive(Eq,
    Debug
    )

    FactDiagnosticKind::equal

    automatically derived

    FactDiagnosticKind::not_equal

    automatically derived

    FactDiagnosticKind::to_repr

    automatically derived

    FactDiagnosticSeverity

    pub(all) enum FactDiagnosticSeverity {
    Error
    Warning
    } derive(Eq,
    Debug
    )

    FactDiagnosticSeverity::equal

    automatically derived

    FactDiagnosticSeverity::not_equal

    automatically derived

    FactDiagnosticSeverity::to_repr

    automatically derived

    FactExportRow

    pub(all) struct FactExportRow {
    fact_id : String?
    concept : String
    namespace_uri : String
    local_name : String
    context_ref : String
    entity_scheme : String
    entity_identifier : String
    period_type : String
    instant : String?
    start_date : String?
    end_date : String?
    unit_ref : String?
    unit : String?
    value : String
    canonical_value : String?
    nil : Bool
    decimals : String?
    precision : String?
    language : String?
    dimensions_json : String
    } derive(Eq,
    Debug
    )

    FactExportRow::equal

    automatically derived

    FactExportRow::not_equal

    fn FactExportRow::not_equal(x : FactExportRow, y : FactExportRow) -> Bool
    automatically derived

    FactExportRow::to_repr

    automatically derived

    FactIntegrityReport

    pub(all) struct FactIntegrityReport {
    diagnostics : Array[FactDiagnostic]
    } derive(Eq,
    Debug
    )

    FactIntegrityReport::equal

    automatically derived

    FactIntegrityReport::error_count

    fn FactIntegrityReport::error_count(self : FactIntegrityReport) -> Int

    FactIntegrityReport::has_errors

    fn FactIntegrityReport::has_errors(self : FactIntegrityReport) -> Bool

    FactIntegrityReport::not_equal

    automatically derived

    FactIntegrityReport::to_repr

    automatically derived

    FactIntegrityReport::warning_count

    fn FactIntegrityReport::warning_count(self : FactIntegrityReport) -> Int

    pub(all) struct FootnoteLink {
    role_uri : String
    locators : Array[LinkLocator]
    footnotes : Array[FootnoteResource]
    arcs : Array[LinkArc]
    offset : Int
    } derive(Eq,
    Debug
    )

    FootnoteLink::equal

    automatically derived

    FootnoteLink::not_equal

    fn FootnoteLink::not_equal(x : FootnoteLink, y : FootnoteLink) -> Bool
    automatically derived

    FootnoteLink::to_repr

    automatically derived

    FootnoteResource

    pub(all) struct FootnoteResource {
    label : String
    role_uri : String
    language : String?
    text : String
    offset : Int
    } derive(Eq,
    Debug
    )

    FootnoteResource::equal

    automatically derived

    FootnoteResource::not_equal

    fn FootnoteResource::not_equal(x : FootnoteResource, y : FootnoteResource) -> Bool
    automatically derived

    FootnoteResource::to_repr

    automatically derived
    pub(all) struct LabelLink {
    role_uri : String
    locators : Array[LinkLocator]
    labels : Array[LabelResource]
    arcs : Array[LinkArc]
    offset : Int
    } derive(Eq,
    Debug
    )

    LabelLink::equal

    fn LabelLink::equal(LabelLink, LabelLink) -> Bool
    automatically derived

    LabelLink::not_equal

    fn LabelLink::not_equal(x : LabelLink, y : LabelLink) -> Bool
    automatically derived

    LabelLink::to_repr

    automatically derived

    LabelResource

    pub(all) struct LabelResource {
    label : String
    role_uri : String
    language : String?
    text : String
    offset : Int
    } derive(Eq,
    Debug
    )

    LabelResource::equal

    automatically derived

    LabelResource::not_equal

    fn LabelResource::not_equal(x : LabelResource, y : LabelResource) -> Bool
    automatically derived

    LabelResource::to_repr

    automatically derived

    LinkArc

    pub(all) struct LinkArc {
    from_label : String
    to_label : String
    arcrole : String
    order : Decimal?
    weight : Decimal?
    preferred_label : QName?
    arc_use : ArcUse
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    LinkArc::equal

    fn LinkArc::equal(LinkArc, LinkArc) -> Bool
    automatically derived

    LinkArc::not_equal

    fn LinkArc::not_equal(x : LinkArc, y : LinkArc) -> Bool
    automatically derived

    LinkArc::to_repr

    automatically derived

    LinkLocator

    pub(all) struct LinkLocator {
    label : String
    href : String
    offset : Int
    } derive(Eq,
    Debug
    )

    LinkLocator::equal

    fn LinkLocator::equal(LinkLocator, LinkLocator) -> Bool
    automatically derived

    LinkLocator::not_equal

    fn LinkLocator::not_equal(x : LinkLocator, y : LinkLocator) -> Bool
    automatically derived

    LinkLocator::to_repr

    automatically derived

    NamespaceBinding

    pub(all) struct NamespaceBinding {
    prefix : String
    uri : String
    } derive(Eq,
    Debug
    )

    NamespaceBinding::equal

    automatically derived

    NamespaceBinding::new

    fn NamespaceBinding::new(prefix : String, uri : String) -> NamespaceBinding

    NamespaceBinding::not_equal

    fn NamespaceBinding::not_equal(x : NamespaceBinding, y : NamespaceBinding) -> Bool
    automatically derived

    NamespaceBinding::to_repr

    automatically derived
    pub(all) struct PresentationLink {
    role_uri : String
    locators : Array[LinkLocator]
    arcs : Array[LinkArc]
    offset : Int
    } derive(Eq,
    Debug
    )

    PresentationLink::equal

    automatically derived

    PresentationLink::not_equal

    fn PresentationLink::not_equal(x : PresentationLink, y : PresentationLink) -> Bool
    automatically derived

    PresentationLink::to_repr

    automatically derived

    PresentationRelation

    pub(all) struct PresentationRelation {
    link_role_uri : String
    parent : QName
    child : QName
    order : Decimal?
    preferred_label : QName?
    priority : Int
    offset : Int
    } derive(Eq,
    Debug
    )

    PresentationRelation::equal

    automatically derived

    PresentationRelation::not_equal

    automatically derived

    PresentationRelation::to_repr

    automatically derived

    QName

    pub(all) struct QName {
    namespace_uri : String
    local_name : String
    } derive(Eq,
    Debug
    )

    Expanded XML qualified name. The empty namespace is retained for no-namespace documents and unprefixed attributes.

    QName::equal

    fn QName::equal(QName, QName) -> Bool
    automatically derived

    QName::expanded

    fn QName::expanded(self : QName) -> String

    QName::local_part

    fn QName::local_part(self : QName) -> String

    QName::matches

    fn QName::matches(self : QName, namespace_uri : String, local_name : String) -> Bool

    QName::namespace_uri

    fn QName::namespace_uri(self : QName) -> String

    QName::new

    fn QName::new(namespace_uri : String, local_name : String) -> Result[QName, XbrlError]

    QName::not_equal

    fn QName::not_equal(x : QName, y : QName) -> Bool
    automatically derived

    QName::to_repr

    automatically derived

    ResolvedTaxonomy

    pub(all) struct ResolvedTaxonomy {
    root_location : String
    schemas : Array[ResolvedTaxonomySchema]
    } derive(Eq,
    Debug
    )

    ResolvedTaxonomy::concept

    fn ResolvedTaxonomy::concept(self : ResolvedTaxonomy, namespace_uri : String, local_name : String) -> XbrlConcept?

    ResolvedTaxonomy::equal

    automatically derived

    ResolvedTaxonomy::not_equal

    fn ResolvedTaxonomy::not_equal(x : ResolvedTaxonomy, y : ResolvedTaxonomy) -> Bool
    automatically derived

    ResolvedTaxonomy::schema

    fn ResolvedTaxonomy::schema(self : ResolvedTaxonomy, location : String) -> ResolvedTaxonomySchema?

    ResolvedTaxonomy::to_repr

    automatically derived

    ResolvedTaxonomySchema

    pub(all) struct ResolvedTaxonomySchema {
    location : String
    schema : XbrlSchema
    source : String
    } derive(Eq,
    Debug
    )

    ResolvedTaxonomySchema::equal

    automatically derived

    ResolvedTaxonomySchema::not_equal

    automatically derived

    ResolvedTaxonomySchema::to_repr

    automatically derived

    RoleRef

    pub(all) struct RoleRef {
    role_uri : String
    href : String
    offset : Int
    } derive(Eq,
    Debug
    )

    RoleRef::equal

    fn RoleRef::equal(RoleRef, RoleRef) -> Bool
    automatically derived

    RoleRef::not_equal

    fn RoleRef::not_equal(x : RoleRef, y : RoleRef) -> Bool
    automatically derived

    RoleRef::to_repr

    automatically derived

    RoleType

    pub(all) struct RoleType {
    id : String
    role_uri : String
    definition : String?
    used_on : Array[QName]
    offset : Int
    } derive(Eq,
    Debug
    )

    RoleType::equal

    fn RoleType::equal(RoleType, RoleType) -> Bool
    automatically derived

    RoleType::not_equal

    fn RoleType::not_equal(x : RoleType, y : RoleType) -> Bool
    automatically derived

    RoleType::to_repr

    automatically derived

    SecurityAudit

    pub(all) struct SecurityAudit {
    source_bytes : Int
    xml_nodes : Int
    contexts : Int
    units : Int
    facts : Int
    } derive(Eq,
    Debug
    )

    SecurityAudit::equal

    automatically derived

    SecurityAudit::not_equal

    fn SecurityAudit::not_equal(x : SecurityAudit, y : SecurityAudit) -> Bool
    automatically derived

    SecurityAudit::to_repr

    automatically derived

    TaxonomyCatalog

    pub(all) struct TaxonomyCatalog {
    entries : Array[TaxonomyCatalogEntry]
    } derive(Eq,
    Debug
    )

    TaxonomyCatalog::add

    fn TaxonomyCatalog::add(self : TaxonomyCatalog, location : String, namespace_uri : String, source : StringView) -> Result[Unit, XbrlError]

    TaxonomyCatalog::entry

    fn TaxonomyCatalog::entry(self : TaxonomyCatalog, location : String) -> TaxonomyCatalogEntry?

    TaxonomyCatalog::equal

    automatically derived

    TaxonomyCatalog::new

    TaxonomyCatalog::not_equal

    fn TaxonomyCatalog::not_equal(x : TaxonomyCatalog, y : TaxonomyCatalog) -> Bool
    automatically derived

    TaxonomyCatalog::resolve

    fn TaxonomyCatalog::resolve(self : TaxonomyCatalog, root_location : String, limits : XbrlLimits) -> Result[ResolvedTaxonomy, XbrlError]

    TaxonomyCatalog::to_repr

    automatically derived

    TaxonomyCatalogEntry

    pub(all) struct TaxonomyCatalogEntry {
    location : String
    namespace_uri : String
    source : String
    } derive(Eq,
    Debug
    )

    TaxonomyCatalogEntry::equal

    automatically derived

    TaxonomyCatalogEntry::not_equal

    automatically derived

    TaxonomyCatalogEntry::to_repr

    automatically derived

    TaxonomyImport

    pub(all) struct TaxonomyImport {
    namespace_uri : String
    schema_location : String?
    offset : Int
    } derive(Eq,
    Debug
    )

    TaxonomyImport::equal

    automatically derived

    TaxonomyImport::not_equal

    fn TaxonomyImport::not_equal(x : TaxonomyImport, y : TaxonomyImport) -> Bool
    automatically derived

    TaxonomyImport::to_repr

    automatically derived

    XbrlConcept

    pub(all) struct XbrlConcept {
    name : QName
    id : String?
    type_name : QName
    substitution_group : QName
    kind : ConceptKind
    period_type : ConceptPeriodType
    balance : ConceptBalance
    is_abstract : Bool
    nillable : Bool
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlConcept::equal

    fn XbrlConcept::equal(XbrlConcept, XbrlConcept) -> Bool
    automatically derived

    XbrlConcept::not_equal

    fn XbrlConcept::not_equal(x : XbrlConcept, y : XbrlConcept) -> Bool
    automatically derived

    XbrlConcept::to_repr

    automatically derived

    XbrlContext

    pub(all) struct XbrlContext {
    id : String
    entity_scheme : String
    entity_identifier : String
    period : XbrlPeriod
    segment : XmlNode?
    scenario : XmlNode?
    dimensions : Array[DimensionMember]
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlContext::dimension

    fn XbrlContext::dimension(self : XbrlContext, dimension : QName) -> DimensionMember?

    XbrlContext::equal

    fn XbrlContext::equal(XbrlContext, XbrlContext) -> Bool
    automatically derived

    XbrlContext::not_equal

    fn XbrlContext::not_equal(x : XbrlContext, y : XbrlContext) -> Bool
    automatically derived

    XbrlContext::to_repr

    automatically derived

    XbrlError

    pub(all) enum XbrlError {
    InvalidLimit(String, Int)
    LimitExceeded(String, Int, Int)
    InvalidQName(String, Int)
    MissingNamespace(String, Int)
    XmlSyntax(String, Int)
    UnsafeXml(String, Int)
    InvalidDecimal(String, Int)
    InvalidContext(String, Int)
    InvalidUnit(String, Int)
    InvalidTaxonomy(String, Int)
    InvalidLinkbase(String, Int)
    MissingConcept(String)
    UnresolvedReference(String)
    InvalidDimension(String, Int)
    DuplicateFact(String, Int)
    CalculationMismatch(String, String, String)
    InvalidFact(String, Int)
    UnsupportedFeature(String)
    Io(String)
    } derive(Eq,
    Debug
    )

    impl Show for XbrlError

    XbrlError::equal

    fn XbrlError::equal(XbrlError, XbrlError) -> Bool
    automatically derived

    XbrlError::not_equal

    fn XbrlError::not_equal(x : XbrlError, y : XbrlError) -> Bool
    automatically derived

    XbrlError::output

    fn XbrlError::output(self : XbrlError, logger : &Logger) -> Unit

    XbrlError::to_repr

    automatically derived

    XbrlError::to_string

    fn XbrlError::to_string(self : XbrlError) -> String

    Default implementation for Show::to_string, uses a StringBuilder

    XbrlFact

    pub(all) struct XbrlFact {
    id : String?
    concept : QName
    context_ref : String
    unit_ref : String?
    decimals : String?
    precision : String?
    language : String?
    value : String
    nil : Bool
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlFact::equal

    fn XbrlFact::equal(XbrlFact, XbrlFact) -> Bool
    automatically derived

    XbrlFact::not_equal

    fn XbrlFact::not_equal(x : XbrlFact, y : XbrlFact) -> Bool
    automatically derived

    XbrlFact::to_repr

    automatically derived

    XbrlInstance

    pub(all) struct XbrlInstance {
    schema_refs : Array[String]
    contexts : Array[XbrlContext]
    units : Array[XbrlUnitDefinition]
    facts : Array[XbrlFact]
    tuples : Array[XbrlTuple]
    } derive(Eq,
    Debug
    )

    XbrlInstance::context

    fn XbrlInstance::context(self : XbrlInstance, id : String) -> XbrlContext?

    XbrlInstance::equal

    automatically derived

    XbrlInstance::fact_integrity

    fn XbrlInstance::fact_integrity(self : XbrlInstance) -> FactIntegrityReport

    XbrlInstance::facts_for_concept

    fn XbrlInstance::facts_for_concept(self : XbrlInstance, concept : QName) -> Array[XbrlFact]

    XbrlInstance::facts_for_context

    fn XbrlInstance::facts_for_context(self : XbrlInstance, id : String) -> Array[XbrlFact]

    XbrlInstance::not_equal

    fn XbrlInstance::not_equal(x : XbrlInstance, y : XbrlInstance) -> Bool
    automatically derived

    XbrlInstance::to_repr

    automatically derived

    XbrlInstance::unit

    fn XbrlInstance::unit(self : XbrlInstance, id : String) -> XbrlUnitDefinition?

    XbrlLimits

    pub(all) struct XbrlLimits {
    max_source_bytes : Int
    max_xml_depth : Int
    max_xml_nodes : Int
    max_attributes_per_element : Int
    max_text_bytes : Int
    max_facts : Int
    max_taxonomy_documents : Int
    max_linkbase_arcs : Int
    } derive(Eq,
    Debug
    )

    XbrlLimits::check_attributes

    fn XbrlLimits::check_attributes(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_depth

    fn XbrlLimits::check_depth(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_facts

    fn XbrlLimits::check_facts(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_linkbase_arcs

    fn XbrlLimits::check_linkbase_arcs(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_nodes

    fn XbrlLimits::check_nodes(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_source

    fn XbrlLimits::check_source(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_taxonomy_documents

    fn XbrlLimits::check_taxonomy_documents(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::check_text

    fn XbrlLimits::check_text(self : XbrlLimits, actual : Int) -> Result[Unit, XbrlError]

    XbrlLimits::default

    fn XbrlLimits::default() -> XbrlLimits

    XbrlLimits::equal

    fn XbrlLimits::equal(XbrlLimits, XbrlLimits) -> Bool
    automatically derived

    XbrlLimits::not_equal

    fn XbrlLimits::not_equal(x : XbrlLimits, y : XbrlLimits) -> Bool
    automatically derived

    XbrlLimits::strict

    fn XbrlLimits::strict() -> XbrlLimits

    XbrlLimits::to_repr

    automatically derived

    XbrlLimits::validate

    fn XbrlLimits::validate(self : XbrlLimits) -> Result[Unit, XbrlError]

    XbrlLinkbase

    pub(all) struct XbrlLinkbase {
    label_links : Array[LabelLink]
    presentation_links : Array[PresentationLink]
    calculation_links : Array[CalculationLink]
    footnote_links : Array[FootnoteLink]
    role_refs : Array[RoleRef]
    arcrole_refs : Array[ArcroleRef]
    } derive(Eq,
    Debug
    )

    XbrlLinkbase::calculation_groups

    fn XbrlLinkbase::calculation_groups(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy) -> Result[Array[CalculationGroup], XbrlError]

    XbrlLinkbase::calculation_relations

    fn XbrlLinkbase::calculation_relations(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy) -> Result[Array[CalculationRelation], XbrlError]

    XbrlLinkbase::check_calculations

    fn XbrlLinkbase::check_calculations(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy, instance : XbrlInstance) -> Result[CalculationReport, XbrlError]

    XbrlLinkbase::equal

    automatically derived

    XbrlLinkbase::labels

    XbrlLinkbase::not_equal

    fn XbrlLinkbase::not_equal(x : XbrlLinkbase, y : XbrlLinkbase) -> Bool
    automatically derived

    XbrlLinkbase::presentation_relations

    fn XbrlLinkbase::presentation_relations(self : XbrlLinkbase, taxonomy : ResolvedTaxonomy) -> Result[Array[PresentationRelation], XbrlError]

    XbrlLinkbase::to_repr

    automatically derived

    XbrlPeriod

    pub(all) enum XbrlPeriod {
    Instant(String)
    Duration(String, String)
    } derive(Eq,
    Debug
    )

    XbrlPeriod::equal

    fn XbrlPeriod::equal(XbrlPeriod, XbrlPeriod) -> Bool
    automatically derived

    XbrlPeriod::not_equal

    fn XbrlPeriod::not_equal(x : XbrlPeriod, y : XbrlPeriod) -> Bool
    automatically derived

    XbrlPeriod::to_repr

    automatically derived

    XbrlSchema

    pub(all) struct XbrlSchema {
    target_namespace : String
    imports : Array[TaxonomyImport]
    concepts : Array[XbrlConcept]
    role_types : Array[RoleType]
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlSchema::concept

    fn XbrlSchema::concept(self : XbrlSchema, namespace_uri : String, local_name : String) -> XbrlConcept?

    XbrlSchema::equal

    fn XbrlSchema::equal(XbrlSchema, XbrlSchema) -> Bool
    automatically derived

    XbrlSchema::not_equal

    fn XbrlSchema::not_equal(x : XbrlSchema, y : XbrlSchema) -> Bool
    automatically derived

    XbrlSchema::to_repr

    automatically derived

    XbrlTuple

    pub(all) struct XbrlTuple {
    id : String?
    concept : QName
    facts : Array[XbrlFact]
    tuples : Array[XbrlTuple]
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlTuple::equal

    fn XbrlTuple::equal(XbrlTuple, XbrlTuple) -> Bool
    automatically derived

    XbrlTuple::not_equal

    fn XbrlTuple::not_equal(x : XbrlTuple, y : XbrlTuple) -> Bool
    automatically derived

    XbrlTuple::to_repr

    automatically derived

    XbrlUnit

    pub(all) enum XbrlUnit {
    Simple(QName)
    Divide(Array[QName], Array[QName])
    } derive(Eq,
    Debug
    )

    XbrlUnit::equal

    fn XbrlUnit::equal(XbrlUnit, XbrlUnit) -> Bool
    automatically derived

    XbrlUnit::not_equal

    fn XbrlUnit::not_equal(x : XbrlUnit, y : XbrlUnit) -> Bool
    automatically derived

    XbrlUnit::to_repr

    automatically derived

    XbrlUnitDefinition

    pub(all) struct XbrlUnitDefinition {
    id : String
    unit : XbrlUnit
    offset : Int
    } derive(Eq,
    Debug
    )

    XbrlUnitDefinition::equal

    automatically derived

    XbrlUnitDefinition::not_equal

    automatically derived

    XbrlUnitDefinition::to_repr

    automatically derived

    XmlAttribute

    pub(all) struct XmlAttribute {
    name : QName
    value : String
    offset : Int
    } derive(Eq,
    Debug
    )

    XmlAttribute::equal

    automatically derived

    XmlAttribute::not_equal

    fn XmlAttribute::not_equal(x : XmlAttribute, y : XmlAttribute) -> Bool
    automatically derived

    XmlAttribute::to_repr

    automatically derived

    XmlDocument

    pub(all) struct XmlDocument {
    root : XmlNode
    } derive(Eq,
    Debug
    )

    XmlDocument::equal

    fn XmlDocument::equal(XmlDocument, XmlDocument) -> Bool
    automatically derived

    XmlDocument::not_equal

    fn XmlDocument::not_equal(x : XmlDocument, y : XmlDocument) -> Bool
    automatically derived

    XmlDocument::to_repr

    automatically derived

    XmlNode

    pub(all) struct XmlNode {
    name : QName
    attributes : Array[XmlAttribute]
    namespaces : Array[NamespaceBinding]
    children : Array[XmlNode]
    text : String
    offset : Int
    } derive(Eq,
    Debug
    )

    XmlNode::attribute

    fn XmlNode::attribute(self : XmlNode, namespace_uri : String, local_name : String) -> String?

    XmlNode::attribute_by_local

    fn XmlNode::attribute_by_local(self : XmlNode, local_name : String) -> String?

    XmlNode::child

    fn XmlNode::child(self : XmlNode, namespace_uri : String, local_name : String) -> XmlNode?

    XmlNode::children_named

    fn XmlNode::children_named(self : XmlNode, namespace_uri : String, local_name : String) -> Array[XmlNode]

    XmlNode::equal

    fn XmlNode::equal(XmlNode, XmlNode) -> Bool
    automatically derived

    XmlNode::not_equal

    fn XmlNode::not_equal(x : XmlNode, y : XmlNode) -> Bool
    automatically derived

    XmlNode::to_repr

    automatically derived

    audit_instance_source

    fn audit_instance_source(source : StringView, limits : XbrlLimits) -> Result[SecurityAudit, XbrlError]

    check_calculations

    fn check_calculations(linkbase : XbrlLinkbase, taxonomy : ResolvedTaxonomy, instance : XbrlInstance) -> Result[CalculationReport, XbrlError]

    check_fact_integrity

    fn check_fact_integrity(instance : XbrlInstance) -> FactIntegrityReport

    cli_help_text

    fn cli_help_text() -> String

    export_csv

    fn export_csv(instance : XbrlInstance) -> Result[String, XbrlError]

    export_json

    fn export_json(instance : XbrlInstance) -> Result[String, XbrlError]

    export_rows

    fn export_rows(instance : XbrlInstance) -> Result[Array[FactExportRow], XbrlError]

    parse_context_dimensions

    fn parse_context_dimensions(segment : XmlNode?, scenario : XmlNode?) -> Result[Array[DimensionMember], XbrlError]

    parse_extension_nodes

    fn parse_extension_nodes(nodes : Array[XmlNode], contexts : Array[XbrlContext], units : Array[XbrlUnitDefinition], limits : XbrlLimits) -> Result[(Array[XbrlFact], Array[XbrlTuple]), XbrlError]

    parse_instance

    fn parse_instance(document : XmlDocument, limits : XbrlLimits) -> Result[XbrlInstance, XbrlError]

    parse_instance_xml

    fn parse_instance_xml(source : StringView, limits : XbrlLimits) -> Result[XbrlInstance, XbrlError]

    parse_invocation

    fn parse_invocation(args : ArrayView[String]) -> Result[CliInvocation, CliError]

    parse_linkbase

    fn parse_linkbase(document : XmlDocument, limits : XbrlLimits) -> Result[XbrlLinkbase, XbrlError]

    parse_linkbase_xml

    fn parse_linkbase_xml(source : StringView, limits : XbrlLimits) -> Result[XbrlLinkbase, XbrlError]

    parse_taxonomy

    fn parse_taxonomy(document : XmlDocument) -> Result[XbrlSchema, XbrlError]

    parse_taxonomy_xml

    fn parse_taxonomy_xml(source : StringView, limits : XbrlLimits) -> Result[XbrlSchema, XbrlError]

    parse_xml

    fn parse_xml(source : StringView, limits : XbrlLimits) -> Result[XmlDocument, XbrlError]

    resolve_qname

    fn resolve_qname(lexical : StringView, bindings : Array[NamespaceBinding], use_default_namespace : Bool) -> Result[QName, XbrlError]

    Resolves prefix:local against a namespace stack encoded as ordered bindings. Later bindings shadow earlier ones. The default namespace applies only to elements, which is why the caller chooses whether to use it.

    run

    fn run(args : ArrayView[String]) -> CliResult

    version

    fn version() -> String