[XML-SIG] SAX Namespaces

Lars Marius Garshol larsga@garshol.priv.no
04 Jul 2000 11:44:37 +0200


* Lars Marius Garshol
|
| At the moment expat represents namespace names as 'uri localname'.
| What I would want pyexpat.c to do is to turn those cooked strings into
| ('uri', 'localname') tuples. So it's not a matter of reimplementing
| anything, but just of improving the interface.

* Greg Stein
| 
| Simple code:
| 
| const char *space = strchr(name, ' ');
| PyObject *obNS = PyString_FromStringAndSize(name, space - name);
| PyObject *obName = PyString_FromString(space + 1);

Bingo.
 
| Of course, I don't know how to get the original prefix/rawname...

As far as I can tell expat does not make it available. However, SAX
does not require this, so that's OK.

--Lars M.