chilkat, sax, dom

  • You can use xml.dom.minidom to parse and write xml files. It's already integrated in the images. You could also install pyxml, but it takes nearly 2 mb.

    • Offizieller Beitrag

    I don't recommend anyone to youse minidom for creating xml on dreamboxes.
    As you are working on an embedded Device you should always think about performance and minidom uses LOTS of CPU-Time.


    When having a look at some xml-creating components of enigma2 (including the webinterface, timers etc.) you'll soon recognize you won't find any usage of xml.minidom for creating xml.


    Oh... we are talking about performance differences you can easily measure in seconds...


    If i remeber it correct we had an performance improvement which was at about factor 5 to 10 when switching to "manually created xml" on the webinterface (searching the epg for all titles with the letter e).


    The bigger the xml is, the more you'll recognize the difference.

    mfg ,
    Reichi

    5 Mal editiert, zuletzt von Reichi ()

  • Ok i used


    from xml.dom import minidom
    xmldoc = minidom.parse('sth.xml')


    and it parese fast on Linux... need to check it on DM,


    it is short sthlist.xml, with some attributes.. :winking_face:


    thx

  • i ve got last Question, how I can Read to eListboxEntry ( left, right changing)


    to see


    XML
    <?xml version="1.0" encoding="iso-8859-1"?>
    <sthlist>
    <test name="XXXXX" osdname="111" testscript="" />
    <test name="ZZZZZ" osdname="222" testscript="" /> 
    </sthlist>


    and Read NAME attribute to eListBoxEntry - to changing left,right and see this ??

    Einmal editiert, zuletzt von tracer ()

  • Any idea about this?


    I ve got ready parser xml


    XML
    <?xml version="1.0" encoding="iso-8859-1"?>
    <sthlist>
    <sth attribute1="XXXXX" attribute2="111" attribute3="" />
    <sth attribute1="ZZZZZ" attribute2="222" attribute3="" /> 
    </sthlist>



    Python
    from xml.dom import minidom
    xmldoc = minidom.parse('/tmp/test.xml')
    xmldoc




    Any one tried make this working ?


    for example just read all attribute1 lines, and put it into somethink like


    new eListBox<eListBoxEntryText>(this);


    I think it is Config Values ? - read attribute1="TEST"


    and we see TEST and wehn we move right or left it will be changed - it depends how many lines we ve got ... any help ?


    Thank you very much

    Einmal editiert, zuletzt von tracer ()