def new(): """ Return a new ``<w:p>`` element. """ xml = '<w:p %s/>' % nsdecls('w') p = oxml_fromstring(xml) return p
def with_nsdecls(self, *nspfxs): """ Cause the element to contain namespace declarations. By default, the namespace prefixes defined in the Builder class are used. These can be overridden by providing exlicit prefixes, e.g. ``with_nsdecls('a', 'r')``. """ if not nspfxs: nspfxs = self.__nspfxs__ self._nsdecls = ' %s' % nsdecls(*nspfxs) return self