Skip to content

Commit

Permalink
fix: bug with segement dimension and member
Browse files Browse the repository at this point in the history
  • Loading branch information
joeychilson committed Mar 15, 2024
1 parent d747e77 commit 9d71994
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/xbrl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@ fn parse_contexts(root: &Node, xbrldi_ns: &str) -> HashMap<String, Context> {
.children()
.filter(|node| node.has_tag_name((xbrldi_ns, "explicitMember")))
{
let dimension = member_node
.attribute("dimension")
.and_then(|s| s.strip_prefix("xxx:"))
.unwrap_or("");
let member = member_node.text().unwrap_or("");
let raw_dimension = member_node.attribute("dimension").unwrap().to_owned();
let dimension = raw_dimension.split(':').nth(1).unwrap_or("");
let raw_member = member_node.text().unwrap_or_default().to_owned();
let member = raw_member.split(':').nth(1).unwrap_or("");

segments.push(Segment {
dimension: Rc::new(dimension.to_owned()),
Expand Down

0 comments on commit 9d71994

Please sign in to comment.