xmlns attribute of the root xml element or null if text is not xml-formatted or does not have a namespace.
auto xmlData = `<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">`; assert(getXMLnamespaceFromData(xmlData) == "http://www.freedesktop.org/standards/shared-mime-info"); assert(getXMLnamespaceFromData("<start-element>") == string.init); assert(getXMLnamespaceFromData("") == string.init);
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.