I have the following XML file
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-model href="../tool/rules/rules.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<block name="test_debug" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://my-specific-ns"
xsi:noNamespaceSchemaLocation="../tool/rules/schema.xsd" simul="true">
</block>
And my Python3 code is the following
XmlRoot = ET.parse('test.xml').getroot() #type: ElementTree
XmlRoot.attrib
and I get the following output
{'name': 'test_debug', '{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation': '../tool/rules/schema.xsd', 'simul': 'true'}
I do not understand why there are two attributes missing.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
and
xmlns="http://my-specific-ns"
I am interested in getting the xmlns attribute. Because its the namespace used by through my XML files and it will make it easier to search for specific paths.
PS I'm using Python 3.7.
/Regards