{"record":{"id":"9e4ea3e236d19400","repo":"flxzt/rnote","slug":"err-while-parsing-style-attribute-of-xoppbackgro-9e4ea3","errorCode":null,"errorMessage":"Err while parsing `style` attribute of XoppBackground with node id {:?}, is not a valid value","messagePattern":"Err while parsing `style` attribute of XoppBackground with node id (.+?), is not a valid value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/xoppformat.rs","lineNumber":398,"sourceCode":"                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;\n            }\n            _ => {\n                return Err(anyhow::anyhow!(\"Failed to parse `type` attribute of XoppBackground with node id {:?}, is not a valid value\", node.id()));\n            }\n        }\n","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/xoppformat.rs#L380-L416","documentation":"XML parsing error in XoppBackground::load_from_xml: the `style` attribute of a solid background could not be parsed into a valid style value, so the background is rejected during .xopp import. The style attribute is missing or not one of the accepted values.","triggerScenarios":"load_from_xml on a <background type=\"pixmap\"> whose domain is present but unrecognized, e.g. domain=\"relative\" or a newer Xournal++ domain value.","commonSituations":"Files from newer Xournal++ with extra domain modes; typos like 'absoulte'; custom tools inventing domain values.","solutions":["Correct the `style` attribute on the background node to a value Xournal++ writes (plain, lined, ruled, dotted, graph, isodotted, etc.).","Re-export the file from Xournal++ to normalize the attribute.","Remove the style or convert the background manually if it is unsupported by rnote's importer."],"exampleFix":"// before\n<background type=\"pixmap\" domain=\"relative\" filename=\"bg.png\"/>\n// after\n<background type=\"pixmap\" domain=\"absolute\" filename=\"bg.png\"/>","handlingStrategy":"validation","validationCode":"fn pixmap_domain_known(node: &roxmltree::Node) -> bool {\n    matches!(node.attribute(\"domain\"), Some(\"absolute\") | Some(\"attach\") | Some(\"clone\"))\n}","typeGuard":null,"tryCatchPattern":"match domain_value {\n    \"absolute\" => ..., \"attach\" => ..., \"clone\" => ...,\n    other => {\n        warn!(\"unknown domain {}, defaulting to absolute\", other);\n        ...\n    }\n}","preventionTips":["Whitelist domain values at generation time","Normalize/trim the attribute before matching","Update parsers when new Xournal++ domain modes appear"],"tags":["xml-parsing","enum-parsing","xopp","rust"],"backgroundTag":"invalid-enum-value","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}