Ignore:
Timestamp:
Aug 4, 2008, 3:44:57 PM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@60
Message:

Add support for pubsub collections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/generic.py

    r24 r30  
    4242    elementStream.parse(string)
    4343    return results and results[0] or None
     44
     45
     46
     47def stripNamespace(rootElement):
     48    namespace = rootElement.uri
     49
     50    def strip(element):
     51        if element.uri == namespace:
     52            element.uri = None
     53            if element.defaultUri == namespace:
     54                element.defaultUri = None
     55            for child in element.elements():
     56                strip(child)
     57
     58    if namespace is not None:
     59        strip(rootElement)
     60
     61    return rootElement
    4462
    4563
Note: See TracChangeset for help on using the changeset viewer.