Example #1
0
 def new():
     """
     Return a new ``<w:p>`` element.
     """
     xml = '<w:p %s/>' % nsdecls('w')
     p = oxml_fromstring(xml)
     return p
Example #2
0
 def new():
     """
     Return a new ``<w:p>`` element.
     """
     xml = '<w:p %s/>' % nsdecls('w')
     p = oxml_fromstring(xml)
     return p
Example #3
0
 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
Example #4
0
 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