Debian Codegraph @

doc/s5/ep2008/atomgen.py

raw
1 # atomgen.py
2
3 import os.path
4
5 from lxml import etree
6 from lxml.builder import ElementMaker
7
8 ATOM_NAMESPACE = "http://www.w3.org/2005/Atom"
9
10 A = ElementMaker(namespace=ATOM_NAMESPACE,
11 nsmap={None : ATOM_NAMESPACE})
12
13 feed = A.feed
14 entry = A.entry
15 title = A.title
16 author = A.author
17 name = A.name
18 link = A.link
19 summary = A.summary
20 id = A.id
21 updated = A.updated
22 # ... and so on and so forth ...
23
24
25 # plus a little validation function: isvalid()
26 isvalid = etree.RelaxNG(
27 file=os.path.join(os.path.abspath(os.path.dirname(__file__)), "atom.rng"))