{"record":{"id":"d00bdb9228bf4fdb","repo":"flxzt/rnote","slug":"failed-to-parse-right-attribute-in-xopptext-with","errorCode":null,"errorMessage":"failed to parse `right` attribute in XoppText with node id {:?}, could not find attribute","messagePattern":"failed to parse `right` attribute in XoppText with node id (.+?), could not find attribute","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/xoppformat.rs","lineNumber":979,"sourceCode":"            })?\n            .parse::<f64>()?;\n\n        // Top\n        self.top = node\n            .attribute(\"top\")\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"failed to parse `top` attribute in XoppText with node id {:?}, could not find attribute\",\n                    node.id()\n                )\n            })?\n            .parse::<f64>()?;\n\n        // Right\n        self.right = node\n            .attribute(\"right\")\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"failed to parse `right` attribute in XoppText with node id {:?}, could not find attribute\",\n                    node.id()\n                )\n            })?\n            .parse::<f64>()?;\n\n        // Bottom\n        self.bottom = node\n            .attribute(\"bottom\")\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"failed to parse `bottom` attribute in XoppText with node id {:?}, could not find attribute\",\n                    node.id()\n                )\n            })?\n            .parse::<f64>()?;\n\n        // Data","sourceCodeStart":961,"sourceCodeEnd":997,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/xoppformat.rs#L961-L997","documentation":"Thrown when a `<text>` element in a .xopp file has no `right` attribute during XoppText parsing. The parser needs all four bounds (top/left/right/bottom) to reconstruct the text's rectangle; missing `right` means the document is malformed.","triggerScenarios":"Loading a .xopp file whose `<text>` node lacks a `right` XML attribute via the xopp format importer.","commonSituations":"Files generated by custom scripts that only write x/y position; hand-edited documents; older or incompatible Xournal++ file variants.","solutions":["Re-save the file with Xournal++ to regenerate complete bounds attributes.","Add `right=\"...\"` to the `<text>` node with the id shown in the error.","Fix the external generator to emit top/left/right/bottom on every text element.","Validate the xopp XML against expected text-element attributes before importing."],"exampleFix":"// before\n<text left=\"50.0\" top=\"100.0\">...</text>\n// after\n<text left=\"50.0\" top=\"100.0\" right=\"200.0\" bottom=\"150.0\">...</text>","handlingStrategy":"validation","validationCode":"// rust\nfn text_node_has_bounds(node: &roxmltree::Node) -> bool {\n    [\"top\", \"left\", \"right\", \"bottom\"].iter().all(|a| node.attribute(a).is_some())\n}","typeGuard":"fn get_f64_attr(node: &roxmltree::Node, name: &str) -> Option<f64> {\n    node.attribute(name).and_then(|v| v.parse::<f64>().ok())\n}","tryCatchPattern":"match xopp_file.parse() {\n    Ok(doc) => doc,\n    Err(e) if e.to_string().contains(\"`right`\") => {\n        eprintln!(\".xopp text node missing 'right' attribute: {e}\");\n    }\n}","preventionTips":["Emit complete bounds in any tool that writes .xopp files.","Validate xopp XML before loading.","Prefer round-tripping through Xournal++ over manual edits."],"tags":["xml","parsing","file-format"],"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"}