CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 24 Jul 2025 20:09:08 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071208112101
location: https://web.archive.org/web/20071208112101/https://wiki.python.org/moin/LearnPython
server-timing: captures_list;dur=0.594166, exclusion.robots;dur=0.021869, exclusion.robots.policy;dur=0.011885, esindex;dur=0.018191, cdx.remote;dur=47.815170, LoadShardBlock;dur=195.192682, PetaboxLoader3.datanode;dur=189.885649
x-app-server: wwwb-app212
x-ts: 302
x-tr: 267
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app212; 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: Thu, 24 Jul 2025 20:09:09 GMT
content-type: text/html;charset=utf-8
x-archive-orig-date: Sat, 08 Dec 2007 11:21:01 GMT
x-archive-orig-server: Apache/2.0.54 (Debian GNU/Linux) mod_fastcgi/2.4.2
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sat, 08 Dec 2007 11:21:01 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 08 Dec 2007 11:21:01 GMT", ; rel="memento"; datetime="Sat, 08 Dec 2007 11:21:01 GMT", ; rel="next memento"; datetime="Fri, 12 Aug 2011 07:53:49 GMT", ; rel="last memento"; datetime="Sat, 20 Jul 2024 22:48:35 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: 52_1_20071208104348_crawl102-c/52_1_20071208111642_crawl107.arc.gz
server-timing: captures_list;dur=0.509140, exclusion.robots;dur=0.020743, exclusion.robots.policy;dur=0.011249, esindex;dur=0.011303, cdx.remote;dur=15.814334, LoadShardBlock;dur=157.883316, PetaboxLoader3.datanode;dur=169.686547, load_resource;dur=164.391822, PetaboxLoader3.resolve;dur=121.903845
x-app-server: wwwb-app212
x-ts: 200
x-tr: 376
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
LearnPython - PythonInfo Wiki
LearnPython
Learning python by example
Python XML & XSLT
Create and add elements
from xml.dom.minidom import parseString
creating new document, and root element at the same time.
doc = parseString(u'<top/>'.encode('UTF-8'))
print doc.toprettyxml() will show you how it looks
this would create:
<?xml version="1.0" ?> <top/>
Now we reference to our <top/> element by:
top_element=doc.documentElement
We create another element by:
element1=doc.createElementNS(None,u'section1')
Add it under our top element by:
top_element.appendChild(element1)
Create another element and add it under element1
element1.appendChild(doc.createElementNS(None,u'subsection1'))
How to create a text node:
text1=doc.createTextNode(u'My first text')
Since we have no reference to subsection1. We start at reference to element1
element1.firstChild.appendChild(text1)
add second subelement:
element1.appendChild(doc.createElementNS(None,u'subsection2'))
create next text element, and add it to subsection2
text2=doc.createTextNode(u'My second text') element1.lastChild.appendChild(text2)
We are working with references. To switch text in subsections, you could do:
element1.firstChild.appendChild(text2) element1.lastChild.appendChild(text1)
EditText (last edited 2007-04-25 02:57:15 by LukaszSzybalski)
DeleteCache (cached 2007-11-21 17:45:51)- Login
- Navigation
- Actions
- Your recent pages