New method getnamespace.

Since the application never gets to see the namespace abbreviation
used in the XML document, but some applications may need to know them,
we provide this method.
This commit is contained in:
Sjoerd Mullender 2000-08-31 10:27:00 +00:00
parent f730fc3e4e
commit 1c8feae411
2 changed files with 12 additions and 0 deletions

View file

@ -222,6 +222,13 @@ class XMLParser:
else:
i = s + len(str)
# Interface - return a dictionary of all namespaces currently valid
def getnamespace(self):
nsdict = {}
for t, d, nst in self.stack:
nsdict.update(d)
return nsdict
# Internal -- handle data as far as reasonable. May leave state
# and data to be processed by a subsequent call. If 'end' is
# true, force handling all data as if followed by EOF marker.