Get the prefix for the specified namespace (uri) @param u: A namespace uri. @type u: str @return: The namspace. @rtype: (prefix, uri).
(self, u)
| 170 | raise Exception('prefixes exhausted') |
| 171 | |
| 172 | def getprefix(self, u): |
| 173 | """ |
| 174 | Get the prefix for the specified namespace (uri) |
| 175 | @param u: A namespace uri. |
| 176 | @type u: str |
| 177 | @return: The namspace. |
| 178 | @rtype: (prefix, uri). |
| 179 | """ |
| 180 | for ns in Namespace.all: |
| 181 | if u == ns[1]: |
| 182 | return ns[0] |
| 183 | for ns in self.prefixes: |
| 184 | if u == ns[1]: |
| 185 | return ns[0] |
| 186 | raise Exception('ns (%s) not mapped' % u) |
| 187 | |
| 188 | def xlate(self, type): |
| 189 | """ |