![]() :param: filename Set this argument if you want to parse from a file. :param: xml Set this argument if you want to parse from a string. Initialize later XmlDocument will be initialized with "". You can do it later with the 'set' method. You don't have to initialize the XmlDocument during instantiation ![]() There are two ways to initialize the XmlDocument contents: cleaner access to some common lxml.etree functionsÄef _init_(self, xml = '', filename=None): :param: element a normal etree.Element instance I use the following class in my projects. You could use xmltodict but you will have to pay the penalty of parsing the XML again. When I do anything with XML in python I almost always use the lxml package. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |