sheetkit_xml/
namespaces.rs1pub const SPREADSHEET_ML: &str = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
6
7pub const RELATIONSHIPS: &str =
9 "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
10pub const PACKAGE_RELATIONSHIPS: &str =
11 "http://schemas.openxmlformats.org/package/2006/relationships";
12
13pub const CONTENT_TYPES: &str = "http://schemas.openxmlformats.org/package/2006/content-types";
15
16pub const DRAWING_ML: &str = "http://schemas.openxmlformats.org/drawingml/2006/main";
18pub const DRAWING_ML_CHART: &str = "http://schemas.openxmlformats.org/drawingml/2006/chart";
19pub const DRAWING_ML_SPREADSHEET: &str =
20 "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing";
21
22pub const MC: &str = "http://schemas.openxmlformats.org/markup-compatibility/2006";
24
25pub const DC: &str = "http://purl.org/dc/elements/1.1/";
27pub const DC_TERMS: &str = "http://purl.org/dc/terms/";
28
29pub const EXTENDED_PROPERTIES: &str =
31 "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";
32pub const CORE_PROPERTIES: &str =
33 "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
34
35pub const DC_MITYPE: &str = "http://purl.org/dc/dcmitype/";
37
38pub const VT: &str = "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes";
40
41pub const CUSTOM_PROPERTIES: &str =
43 "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";
44
45pub const XML: &str = "http://www.w3.org/XML/1998/namespace";
47pub const XSI: &str = "http://www.w3.org/2001/XMLSchema-instance";
48
49#[cfg(test)]
50mod tests {
51 use super::*;
52
53 #[test]
54 fn test_namespace_constants_are_valid_uris() {
55 let namespaces = [
57 SPREADSHEET_ML,
58 RELATIONSHIPS,
59 PACKAGE_RELATIONSHIPS,
60 CONTENT_TYPES,
61 DRAWING_ML,
62 MC,
63 EXTENDED_PROPERTIES,
64 CORE_PROPERTIES,
65 ];
66 for ns in namespaces {
67 assert!(!ns.is_empty());
68 assert!(
69 ns.starts_with("http://") || ns.starts_with("urn:"),
70 "Namespace should start with http:// or urn: but got: {ns}"
71 );
72 }
73 }
74
75 #[test]
76 fn test_spreadsheet_ml_namespace() {
77 assert_eq!(
78 SPREADSHEET_ML,
79 "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
80 );
81 }
82
83 #[test]
84 fn test_relationships_namespace() {
85 assert_eq!(
86 RELATIONSHIPS,
87 "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
88 );
89 }
90
91 #[test]
92 fn test_content_types_namespace() {
93 assert_eq!(
94 CONTENT_TYPES,
95 "http://schemas.openxmlformats.org/package/2006/content-types"
96 );
97 }
98}