--- MPIWGWeb/xmlhelper.py 2004/08/11 13:02:04 1.3 +++ MPIWGWeb/xmlhelper.py 2004/09/01 09:35:12 1.4 @@ -50,18 +50,20 @@ def proj2hash(xmlstring): sections=Evaluate('section',dom.getElementsByTagName('part')[0])# Parse all Sections #print sections,dom.getElementsByTagName('part')[0] for section in sections: - + sec=parseSection(section) if sec[0]=="WEB_project_header": # Sonderfall project + addToDict(list,'WEB_project_header',sec[1]) # store title addToDict(list,'WEB_project_description',sec[2]) #store description else: # no information in heading + addToDict(list,sec[0],sec[2]) #evaluate higher level sections sections=Evaluate('section/section',dom.getElementsByTagName('part')[0]) - + for section in sections: sec=parseSection(section) @@ -70,7 +72,7 @@ def proj2hash(xmlstring): addToDict(list,'WEB_project_description',sec[2]) #store description else: # no information in heading addToDict(list,sec[0],sec[2]) - + return list @@ -78,9 +80,11 @@ def proj2hash(xmlstring): def parseSection(section): type="" header="" - for heading in section.getElementsByTagName('heading'): - type=heading.getAttribute('class') - header=getText(heading.childNodes) + for heading in section.childNodes: + if getattr(heading,'tagName','')=="heading": + + type=heading.getAttribute('class') + header=getText(heading.childNodes) if type=="": # falls heading fehlt, pruefe ob erster par richtig par=section.getElementsByTagName('par')[0]