{"record":{"id":"be60a604c2dfb77b","repo":"flxzt/rnote","slug":"err-while-parsing-style-attribute-of-xoppbackgro","errorCode":null,"errorMessage":"Err while parsing `style` attribute of XoppBackground, {:?} is not a valid value","messagePattern":"Err while parsing `style` attribute of XoppBackground, (.+?) is not a valid value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/xoppformat.rs","lineNumber":315,"sourceCode":"        }\n    }\n}\n\nimpl FromXmlAttributeValue for XoppBackgroundSolidStyle {\n    fn from_xml_attr_value(s: &str) -> Result<Self, anyhow::Error>\n    where\n        Self: Sized,\n    {\n        match s {\n            \"plain\" => Ok(Self::Plain),\n            \"ruled\" => Ok(Self::Ruled),\n            \"lined\" => Ok(Self::Lined),\n            \"staves\" => Ok(Self::Staves),\n            \"graph\" => Ok(Self::Graph),\n            \"dotted\" => Ok(Self::Dotted),\n            \"isodotted\" => Ok(Self::IsometricDotted),\n            \"isograph\" => Ok(Self::IsometricGraph),\n            o => Err(anyhow::anyhow!(\n                \"Err while parsing `style` attribute of XoppBackground, {:?} is not a valid value\",\n                o\n            )),\n        }\n    }\n}\n\n/// The Xopp background pixmap domain.\n#[derive(Debug, Clone, Serialize, Deserialize)]\npub enum XoppBackgroundPixmapDomain {\n    /// Absolute.\n    Absolute,\n    /// Attach.\n    Attach,\n    /// Clone.\n    Clone,\n}\n","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/xoppformat.rs#L297-L333","documentation":"XoppBackgroundSolidStyle::from_xml_attr_value received a 'style' attribute value that is not one of the known solid background styles (plain, ruled, lined, staves, graph, dotted, isodotted, isograph). The parser rejects unknown enum values.","triggerScenarios":"Parsing a <background type=\"solid\" style=\"...\"> node whose style string is unrecognized, e.g. a style added by a newer Xournal++ or misspelled by hand.","commonSituations":"Files from newer Xournal++ versions with new background styles; typos when editing XML manually; custom exporters emitting nonstandard style names.","solutions":["Check the style value against valid names: plain, ruled, lined, staves, graph, dotted, isodotted, isograph","Open and re-save the file in Xournal++ to normalize the style","Note: in the XoppBackground loader path (error 105) this error is caught and style falls back to Plain; only direct parsing propagates it","Update the engine if the file uses a style added in a newer Xournal++ version"],"exampleFix":"// before\n<background type=\"solid\" style=\"college-ruled\"/>\n// after\n<background type=\"solid\" style=\"ruled\"/>","handlingStrategy":"validation","validationCode":"const SOLID_STYLES: &[&str] = &[\"plain\",\"ruled\",\"lined\",\"staves\",\"graph\",\"dotted\",\"isodotted\",\"isograph\"];\nfn style_is_valid(s: &str) -> bool { SOLID_STYLES.contains(&s) }","typeGuard":null,"tryCatchPattern":"match XoppBackgroundSolidStyle::from_xml_attr_value(style) {\n    Ok(s) => s,\n    Err(e) => {\n        log::warn!(\"unknown solid style, defaulting to Plain: {e}\");\n        XoppBackgroundSolidStyle::Plain\n    }\n}","preventionTips":["Keep a whitelist of valid style strings next to the parser","Normalize case/whitespace before parsing","Handle new Xournal++ styles by updating the match arms"],"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-16T09:17:16.951Z"}