#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    How to retrive data from odt xml file in python?


    I am successfully retreving the odt xml file in python but I have no idea how to pull xml file data?

    Any techniques are there for pulling the odt xml file data.

    Here my code for extracting odt xml file

    #!/usr/lib/python2.7

    import sys, zipfile

    if len(sys.argv) < 2:
    print "input.odt & output.xml"
    sys.exit(0)

    content=""
    myfile = zipfile.ZipFile(sys.argv[1])
    listoffiles = myfile.infolist()
    for s in listoffiles:
    if s.orig_filename == 'content.xml':
    fd = open(sys.argv[2],'w')
    content = myfile.read(s.orig_filename)
    fd.write(content)
    fd.close()
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    138
    Rep Power
    2
    Please elaborate on what "pulling odt xml file data" means.

IMN logo majestic logo threadwatch logo seochat tools logo