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 SLICER_2009: &str = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main";
47pub const SLICER_2010: &str = "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main";
48
49pub const XML: &str = "http://www.w3.org/XML/1998/namespace";
51pub const XSI: &str = "http://www.w3.org/2001/XMLSchema-instance";
52
53#[cfg(test)]
54mod tests {
55 use super::*;
56
57 #[test]
58 fn test_namespace_constants_are_valid_uris() {
59 let namespaces = [
61 SPREADSHEET_ML,
62 RELATIONSHIPS,
63 PACKAGE_RELATIONSHIPS,
64 CONTENT_TYPES,
65 DRAWING_ML,
66 MC,
67 EXTENDED_PROPERTIES,
68 CORE_PROPERTIES,
69 ];
70 for ns in namespaces {
71 assert!(!ns.is_empty());
72 assert!(
73 ns.starts_with("http://") || ns.starts_with("urn:"),
74 "Namespace should start with http:// or urn: but got: {ns}"
75 );
76 }
77 }
78
79 #[test]
80 fn test_spreadsheet_ml_namespace() {
81 assert_eq!(
82 SPREADSHEET_ML,
83 "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
84 );
85 }
86
87 #[test]
88 fn test_relationships_namespace() {
89 assert_eq!(
90 RELATIONSHIPS,
91 "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
92 );
93 }
94
95 #[test]
96 fn test_content_types_namespace() {
97 assert_eq!(
98 CONTENT_TYPES,
99 "http://schemas.openxmlformats.org/package/2006/content-types"
100 );
101 }
102}