xmlutils
¶
Thin layer around xml.etree.ElementTree, to abstract nibabel xml support.
Basic wrapper around FileBasedHeader and XmlSerializable. |
|
|
Base class for defining how to parse xml-based image snippets. |
Basic interface for serializing an object to xml |
XmlBasedHeader
¶
- class nibabel.xmlutils.XmlBasedHeader¶
Bases:
FileBasedHeader
,XmlSerializable
Basic wrapper around FileBasedHeader and XmlSerializable.
- __init__(*args, **kwargs)¶
XmlParser
¶
- class nibabel.xmlutils.XmlParser(encoding='utf-8', buffer_size=35000000, verbose=0)¶
Bases:
object
Base class for defining how to parse xml-based image snippets.
- Image-specific parsers should define:
StartElementHandler EndElementHandler CharacterDataHandler
- Parameters:
- encodingstr
string containing xml document
- buffer_size: None or int, optional
size of read buffer. None uses default buffer_size from xml.parsers.expat.
- verboseint, optional
amount of output during parsing (0=silent, by default).
- __init__(encoding='utf-8', buffer_size=35000000, verbose=0)¶
- Parameters:
- encodingstr
string containing xml document
- buffer_size: None or int, optional
size of read buffer. None uses default buffer_size from xml.parsers.expat.
- verboseint, optional
amount of output during parsing (0=silent, by default).
- CharacterDataHandler(data)¶
- EndElementHandler(name)¶
- HANDLER_NAMES = ['StartElementHandler', 'EndElementHandler', 'CharacterDataHandler']¶
- StartElementHandler(name, attrs)¶
- parse(string=None, fname=None, fptr=None)¶
- Parameters:
- stringbytes
string (as a bytes object) containing xml document
- fnamestr
file name of an xml document.
- fptrfile pointer
open file pointer to an xml documents