如果xsd文件是这样的
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xmlns:num="http://www.xbrl.org/dtr/type/numeric" xmlns:nonnum="http://www.xbrl.org/dtr/type/non-numeric" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:ifrs="http://xbrl.ifrs.org/taxonomy/2012-03-29/ifrs" targetNamespace="http://xbrl.ifrs.org/taxonomy/2012-03-29/ifrs" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import schemaLocation="http://www.xbrl.org/dtr/type/numeric-2009-12-16.xsd" namespace="http://www.xbrl.org/dtr/type/numeric"/> <xsd:import schemaLocation="http://www.xbrl.org/dtr/type/nonNumeric-2009-12-16.xsd" namespace="http://www.xbrl.org/dtr/type/non-numeric"/>
<xsd:import schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd" namespace="http://www.xbrl.org/2003/instance"/> <xsd:import schemaLocation="http://www.xbrl.org/2005/xbrldt-2005.xsd" namespace="http://xbrl.org/2005/xbrldt"/>
<xsd:element xbrli:periodType="duration" type="nonnum:domainItemType" substitutionGroup="xbrli:item" nillable="true" name="AbnormallyLargeChangesInAssetPricesOrForeignExchangeRatesMember" id="ifrs_AbnormallyLargeChangesInAssetPricesOrForeignExchangeRatesMember" abstract="true"/>
<xsd:element xbrli:periodType="duration" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" nillable="true" name="AccountingProfit" id="ifrs_AccountingProfit" xbrli:balance="credit"/>
<xsd:element xbrli:periodType="instant" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" nillable="true" name="Accruals" id="ifrs_Accruals" xbrli:balance="credit"/>
<xsd:element xbrli:periodType="instant" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" nillable="true" name="AccrualsClassifiedAsCurrent" id="ifrs_AccrualsClassifiedAsCurrent" xbrli:balance="credit"/>
</xml>
我需要这种格式的字典
d={'AbnormallyLargeChangesInAssetPricesOrForeignExchangeRatesMember':{'xbrli:periodType':'duration','type':'nonnum:domainItemType','substitutionGroup':'xbrli:item'}}
像这样对于每个元素,它应该将属性“名称”打印为标签,并将所有属性作为该标签的值。
我正在尝试使用任何 xml 解析器,我知道如何使用 re........ 但我只需要通过任何 xml 解析器..
提前致谢