{"record":{"id":"9b8ccfea9ca4ad57","repo":"flxzt/rnote","slug":"failed-to-parse-domain-attribute-in-xoppbackgrou","errorCode":null,"errorMessage":"Failed to parse `domain` attribute in XoppBackground with node id {:?}, could not find attribute","messagePattern":"Failed to parse `domain` attribute in XoppBackground with node id (.+?), could not find attribute","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/xoppformat.rs","lineNumber":392,"sourceCode":"                    Err(e) => {\n                        error!(\"Failed to retrieve the XoppBackgroundSolidStyle from `style` attribute, Err: {e:?}\");\n                        XoppBackgroundSolidStyle::Plain\n                    }\n                };\n\n                let color = XoppColor::from_backgroundcolor_attr_value(\n                    node.attribute(\"color\").ok_or_else(|| {\n                        anyhow::anyhow!(\n                            \"Failed to parse `color` attribute in XoppBackground with id {:?}\",\n                            node.id()\n                        )\n                    })?,\n                )?;\n                self.bg_type = XoppBackgroundType::Solid { color, style };\n            }\n            \"pixmap\" => {\n                let domain = match node.attribute(\"domain\").ok_or_else(|| {\n                    anyhow::anyhow!(\"Failed to parse `domain` attribute in XoppBackground with node id {:?}, could not find attribute\", node.id())\n                })? {\n                    \"absolute\" => XoppBackgroundPixmapDomain::Absolute,\n                    \"attach\" => XoppBackgroundPixmapDomain::Attach,\n                    \"clone\" => XoppBackgroundPixmapDomain::Clone,\n                    _ => {\n                        return Err(anyhow::anyhow!(\"Err while parsing `style` attribute of XoppBackground with node id {:?}, is not a valid value\", node.id()));\n                    }\n                };\n                let filename = node\n                    .attribute(\"filename\")\n                    .ok_or_else(|| {\n                        anyhow::anyhow!(\"Failed to parse `filename` attribute in XoppBackground with node id {:?}, could not find attribute\", node.id())\n                    })?\n                    .to_string();\n                self.bg_type = XoppBackgroundType::Pixmap { domain, filename };\n            }\n            \"pdf\" => {\n                self.bg_type = XoppBackgroundType::Pdf;","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/xoppformat.rs#L374-L410","documentation":"For a pixmap XoppBackground, the 'domain' attribute is required and must be one of absolute, attach, or clone. Missing attribute yields this error; a present-but-unknown value yields a sibling error at line 398.","triggerScenarios":"load_from_xml on a <background type=\"pixmap\"> node without 'domain', seen with hand-edited or tool-generated XML that omits it.","commonSituations":"Manually constructing pixmap backgrounds; stripping attributes when cleaning XML; older exporter versions omitting domain.","solutions":["Add domain=\"absolute\" (or \"attach\"/\"clone\") to the pixmap background element","Re-save the file in Xournal++ to regenerate the attribute","Verify the attribute spelling is exactly one of absolute|attach|clone","Use the same domain value the original file's embedded pixmap expects"],"exampleFix":"// before\n<background type=\"pixmap\" filename=\"bg.png\"/>\n// after\n<background type=\"pixmap\" domain=\"absolute\" filename=\"bg.png\"/>","handlingStrategy":"validation","validationCode":"fn pixmap_bg_has_domain(node: &roxmltree::Node) -> bool {\n    matches!(node.attribute(\"domain\"), Some(\"absolute\") | Some(\"attach\") | Some(\"clone\"))\n}","typeGuard":null,"tryCatchPattern":"let domain = node.attribute(\"domain\").unwrap_or(\"absolute\"); // or fail fast\nmatch domain {\n    \"absolute\" | \"attach\" | \"clone\" => {},\n    other => bail!(\"unknown pixmap domain: {}\", other),\n}","preventionTips":["Emit domain whenever emitting type=\"pixmap\"","Only use absolute|attach|clone values","Lint xopp files for pixmap backgrounds before import"],"tags":["xml-parsing","file-formats","xopp","rust"],"backgroundTag":"missing-required-argument","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}