예제 #1
0
 def serialize_locator(locator):
     wrapper = XMLWrapper()
     dom = wrapper.create_document('spreadsheet_locator')
     root = dom.documentElement
     root.setAttribute("version", "1.0")
     locator.serialize(dom,root)
     return dom.toxml()
 def serialize_locator(locator):
     wrapper = XMLWrapper()
     dom = wrapper.create_document('spreadsheet_locator')
     root = dom.documentElement
     root.setAttribute("version", "1.0")
     locator.serialize(dom, root)
     return dom.toxml()
예제 #3
0
 def parse_locator(text):
     locator = None
     wrapper = XMLWrapper()
     dom = wrapper.create_document_from_string(text)
     root = dom.documentElement
     version = None
     version = root.getAttribute('version')
     if version == '1.0':
         for element in named_elements(root, 'locator'):
             if str(element.getAttribute('type')) == 'file':
                 locator = FileLocator.parse(element)
             elif str(element.getAttribute('type')) == 'db':
                 locator = DBLocator.parse(element)
     return locator
 def parse_locator(text):
     locator = None
     wrapper = XMLWrapper()
     dom = wrapper.create_document_from_string(text)
     root = dom.documentElement
     version = None
     version = root.getAttribute('version')
     if version == '1.0':
         for element in named_elements(root, 'locator'):
             if str(element.getAttribute('type')) == 'file':
                 locator = FileLocator.parse(element)
             elif str(element.getAttribute('type')) == 'db':
                 locator = DBLocator.parse(element)
     return locator