MCPcopy Index your code
hub / github.com/python-openxml/python-docx / with_nsdecls

Method with_nsdecls

tests/unitdata.py:74–84  ·  view source on GitHub ↗

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')``.

(self, *nspfxs)

Source from the content-addressed store, hash-verified

72 return self
73
74 def with_nsdecls(self, *nspfxs):
75 """
76 Cause the element to contain namespace declarations. By default, the
77 namespace prefixes defined in the Builder class are used. These can
78 be overridden by providing exlicit prefixes, e.g.
79 ``with_nsdecls('a', 'r')``.
80 """
81 if not nspfxs:
82 nspfxs = self.__nspfxs__
83 self._nsdecls = " %s" % nsdecls(*nspfxs)
84 return self
85
86 def xml(self, indent=0):
87 """

Callers

nothing calls this directly

Calls 1

nsdeclsFunction · 0.90

Tested by

no test coverage detected