Skip to content

Commit 280179c

Browse files
committed
ENH: Permit XmlSerializable.to_xml() to pass kwargs to ElementTree.tostring()
1 parent ce6e9e9 commit 280179c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/xmlutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ def _to_xml_element(self):
2424
""" Output should be a xml.etree.ElementTree.Element"""
2525
raise NotImplementedError()
2626

27-
def to_xml(self, enc='utf-8'):
27+
def to_xml(self, enc='utf-8', **kwargs):
2828
""" Output should be an xml string with the given encoding.
2929
(default: utf-8)"""
3030
ele = self._to_xml_element()
31-
return '' if ele is None else tostring(ele, enc)
31+
return '' if ele is None else tostring(ele, enc, **kwargs)
3232

3333

3434
class XmlBasedHeader(FileBasedHeader, XmlSerializable):

0 commit comments

Comments
 (0)