Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import xml.dom.minidom as minidom
- import base64
- def main():
- xml = minidom.parse('index.xml')
- print '<table border="1">'
- for tnode in xml.getElementsByTagName('tabpage'):
- print '<tr><td colspan="4"><b>%s tab</b></td></tr>' % (
- base64.b64decode(tnode.attributes['name'].value))
- for node in tnode.childNodes:
- if node.attributes.has_key('osc_cs'):
- name = base64.b64decode(node.attributes['name'].value)
- osc = node.attributes['osc_cs'].value
- tp = node.attributes['type'].value
- print '<tr><td>%s</td><td>%s</td><td>%s</td>' % (
- name, tp, osc)
- print '<td><font size="-1">'
- for a in node.attributes.items():
- if a[0] not in ['name', 'osc_cs', 'type']:
- if a[0] == 'text':
- value = base64.b64decode(a[1])
- else:
- value = a[1]
- print '<i>%s</i>: %s ' % (a[0], value)
- print "</font></td></tr>"
- print '</table>'
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement