X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=blobdiff_plain;f=wrw%2Fsp%2Fxhtml.py;h=17c56788729b63cbb631a2a3db547a4dbb441edf;hp=a7debe62f07968c9b9b8c8259816c4d096bef25a;hb=26648796c1d6c3c528ad7cdb108ecb086cfa5784;hpb=a02127330452ddc72406bb1e2e3eeadefe773ebb diff --git a/wrw/sp/xhtml.py b/wrw/sp/xhtml.py index a7debe6..17c5678 100644 --- a/wrw/sp/xhtml.py +++ b/wrw/sp/xhtml.py @@ -14,7 +14,15 @@ class htmlelement(_cons.element): doc.appendChild(self.__todom__(doc)) return doc +class xhtmlcontext(_cons.context): + attrmap = {"klass": "class"} + + def addattr(self, node, k, v): + k = str(k) + node.attrs[self.attrmap.get(k, k)] = str(v) + def cons(ctx=None): + if ctx is None: ctx = xhtmlcontext() return _cons.constructor(ns, htmlelement, ctx) def head(title=None, css=None):