File tree 2 files changed +16
-0
lines changed 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,14 @@ def new():
213
213
objectify .deannotate (relationships , cleanup_namespaces = True )
214
214
return relationships
215
215
216
+ @property
217
+ def xml (self ):
218
+ """
219
+ Return XML string for this element, suitable for saving in a .rels
220
+ stream, not pretty printed and with an XML declaration at the top.
221
+ """
222
+ return oxml_tostring (self , encoding = 'UTF-8' , standalone = True )
223
+
216
224
217
225
class CT_Types (OxmlBaseElement ):
218
226
"""
Original file line number Diff line number Diff line change @@ -98,6 +98,14 @@ def it_can_build_rels_element_incrementally(self):
98
98
pretty_print = True )
99
99
assert actual_xml == expected_rels_xml
100
100
101
+ def it_can_generate_rels_file_xml (self ):
102
+ expected_xml = (
103
+ '<?xml version=\' 1.0\' encoding=\' UTF-8\' standalone=\' yes\' ?>\n '
104
+ '<Relationships xmlns="http://schemas.openxmlformats.org/package'
105
+ '/2006/relationships"/>' .encode ('utf-8' )
106
+ )
107
+ assert CT_Relationships .new ().xml == expected_xml
108
+
101
109
102
110
class DescribeCT_Types (object ):
103
111
You can’t perform that action at this time.
0 commit comments