version 1.1.2.13, 2012/01/13 10:01:28
|
version 1.1.2.15, 2012/02/15 11:51:48
|
Line 92 class xml_handler(ContentHandler):
|
Line 92 class xml_handler(ContentHandler):
|
self.currentName=self.fieldNames[self.currentData] |
self.currentName=self.fieldNames[self.currentData] |
self.currentData+=1 |
self.currentData+=1 |
self.currentTag="data" |
self.currentTag="data" |
|
logging.debug("currentData"+str(self.currentData)) |
|
logging.debug("currentName"+str(self.currentName)) |
|
self.currentRow[self.currentName]="" #anlegen des eintrages |
|
|
def endElement(self,name): |
def endElement(self,name): |
if (name.lower() == "data") : |
if (name.lower() == "data") : |
Line 103 class xml_handler(ContentHandler):
|
Line 106 class xml_handler(ContentHandler):
|
|
|
if self.currentName is not None: |
if self.currentName is not None: |
logging.debug(self.currentName+" "+content) |
logging.debug(self.currentName+" "+content) |
self.currentRow[self.currentName]=content; |
contentTmp = self.currentRow.get(self.currentName,'') #gibt es schon einen Inhalt, dann dieses hinzufuegen (in einem Tag kann u.U. der characters handler mehrfach aufgerufen werden.) |
|
self.currentRow[self.currentName]=contentTmp+content; |
|
|
|
|
def handle_end_row(self): |
def handle_end_row(self): |
Line 113 class xml_handler(ContentHandler):
|
Line 117 class xml_handler(ContentHandler):
|
if self.result.has_key(self.currentRow['key']): |
if self.result.has_key(self.currentRow['key']): |
logging.error("Key %s not unique"%self.currentRow['key']) |
logging.error("Key %s not unique"%self.currentRow['key']) |
|
|
|
logging.debug("currentrow:"+self.currentName) |
|
logging.debug("currentname:"+self.currentRow['key']) |
|
|
if self.currentName is not None: |
if self.currentName is not None: |
self.result[self.currentRow['key']]=self.currentRow.copy() |
self.result[self.currentRow['key']]=self.currentRow.copy() |
# |
# |