PyXB
当元素名称不是 ASCII 时,我无法生成绑定类,有人能指出我正确的方向吗?
最小的可重现示例:
<?xml version="1.0" encoding="utf8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="Country" type="xs:string" />
<xs:element name="Street" type="xs:string" />
<xs:element name="Town" type="xs:string" />
<xs:element name="Дом" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
(寻找<xs:element name="Дом" type="xs:string" />
我使用西里尔文的地方。文件的编码是utf8
。但是,当我尝试时:
pyxbgen -u example.xsd -m example
我得到了错误:
Traceback (most recent call last):
File "/home/sergey/anaconda3/lib/python3.5/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 9, column 26
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sergey/anaconda3/bin/pyxbgen", line 52, in <module>
generator.resolveExternalSchema()
.......
它指向元素的西里尔字母名称。我错过了什么?