CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 16 Jul 2025 19:07:43 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090619212815
location: https://web.archive.org/web/20090619212815/https://wiki.python.org/moin/Sax
server-timing: captures_list;dur=0.919757, exclusion.robots;dur=0.025511, exclusion.robots.policy;dur=0.011053, esindex;dur=0.016678, cdx.remote;dur=5.368028, LoadShardBlock;dur=136.239115, PetaboxLoader3.datanode;dur=109.109035
x-app-server: wwwb-app222
x-ts: 302
x-tr: 177
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app222; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 16 Jul 2025 19:07:44 GMT
content-type: text/html; charset=utf-8
x-archive-orig-date: Fri, 19 Jun 2009 21:28:15 GMT
x-archive-orig-server: Apache/2.2.9 (Debian) mod_fastcgi/2.4.6 mod_python/3.3.1 Python/2.5.2 mod_wsgi/2.3
x-archive-orig-vary: Cookie,User-Agent,Accept-Language
x-archive-orig-content-length: 13783
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 19 Jun 2009 21:28:15 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 22 May 2006 06:38:27 GMT", ; rel="prev memento"; datetime="Sun, 07 Dec 2008 06:12:32 GMT", ; rel="memento"; datetime="Fri, 19 Jun 2009 21:28:15 GMT", ; rel="next memento"; datetime="Wed, 29 Jul 2009 11:45:15 GMT", ; rel="last memento"; datetime="Sat, 27 Jul 2024 22:44:15 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_10_20090619130131_crawl102-c/51_10_20090619212716_crawl103.arc.gz
server-timing: captures_list;dur=0.637392, exclusion.robots;dur=0.023080, exclusion.robots.policy;dur=0.010727, esindex;dur=0.011289, cdx.remote;dur=127.780093, LoadShardBlock;dur=250.372037, PetaboxLoader3.datanode;dur=448.798837, load_resource;dur=504.540483, PetaboxLoader3.resolve;dur=274.378907
x-app-server: wwwb-app222
x-ts: 200
x-tr: 998
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
Sax - PythonInfo Wiki
"Sax" is an XML parser that operates element by element, line by line.
MiniDom sucks up an entire XML file, holds it in memory, and lets you work with it. Sax, on the other hand, emits events as it goes step by step through the file.
Example
1 import xml.sax
2
3 class InkscapeSvgHandler(xml.sax.ContentHandler):
4 def startElement(self, name, attrs):
5 if name == "svg":
6 for (k,v) in attrs.items():
7 print k + " " + v
8
9 parser = xml.sax.make_parser()
10 parser.setContentHandler(InkscapeSvgHandler())
11 parser.parse(open("svg.xml","r"))
Links
HtmlParser -- similar module, tailored to HTML interpretation
Python Library Reference, xml.sax -- API documentation
Python XML FAQ and How-to -- describes sax & MiniDom
SAX: The Simple API for XML -- wordy tutorial
Charming Python:Revisiting XML tools for Python -- kind of old
EditText (last edited 2008-11-15 14:01:03 by localhost)