0
XML 기본 객체 (twisted.words.xish.domish.Element)를 XML 문자열에서 완전히 만들 수 없다는 것에 놀랐습니다.원시 XML에서 twisted.words.xish.domish.Element를 만드는 방법
msg = "<iq to='[email protected]' id='id123' type='get'> \
<query xmlns='http://juick.com/query#messages' mid='123456'/> \
</iq>"
iq = domish.Element(('',''))
iq.addRawXml(msg)
그러나 생성 : 가장 비슷하게 방법은
iq.toXml()
u"<><iq to='[email protected]' id='id123' type='get'> <query xmlns='http://juick.com/query#messages' mid='123456'/> </iq></>"
내 자신 인 IElement 구현을 작성 제외하고 원시 XML을 사용하는 방법은 없나요?
참고 파서가 아닌 유니 STR 오브젝트를 수신한다 ((즉, 'parser.parse (tmp.toXml(). 인코딩 "UTF-8"))'). http://www.mail-archive.com/[email protected]/msg00432.html을 참조하십시오. – HoverHell