//! Simple working XBRL parser use crate::{model::*, Result}; use std::path::Path; #[derive(Default)] pub struct Parser { #[allow(dead_code)] load_linkbases: bool, } impl Parser { pub fn new() -> Self { Self::default() } pub fn parse_str(&self, content: &str) -> Result { self.parse_bytes(content.as_bytes()) } pub fn parse_file>(&self, path: P) -> Result { let content = std::fs::read(path)?; self.parse_bytes(&content) } pub fn parse_bytes(&self, data: &[u8]) -> Result { // Simple XML parsing - just count elements for now let text = String::from_utf8_lossy(data); // Count facts (very simplified) let fact_count = text.matches("