Module mime.xml

Functions for reading XML descriptions of MIME types.

Functions

NameDescription
getXMLnamespaceFromData(xmlData) Get XML namespace from text data. The text is not required to be a data of the whole file. Note however that some xml files may contain a big portion of DOCTYPE declaration at the start.
getXMLnamespaceFromFile(fileName, upTo) Get XML namespace of file.
matchTypeFromString(str) Get symbolic constant of match type according to the string.
readMediaSubtypeFile(filePath) Read MIME type from MEDIA/SUBTYPE.xml file (e.g. image/png.xml).
readMediaSubtypeXML(xmlData) Read MIME type from xml formatted data with mime-type root element as defined by spec.
readMimePackageFile(filePath) Lazily read MIME types from packages/package_name.xml file (e.g. packages/freedesktop.org.xml).
readMimePackageXML(xmlData) Read MIME types from xml formatted data with mime-info root element as defined by spec.
treeMatchTypeFromString(str) Get symbolic constant of tree match type according to the string.

Classes

NameDescription
XMLMimeException Exception that's thrown on invalid XML definition of MIME type.