--- MPIWGWeb/xmlhelper.py 2004/06/28 18:47:14 1.2 +++ MPIWGWeb/xmlhelper.py 2004/08/11 13:02:04 1.3 @@ -76,9 +76,17 @@ def proj2hash(xmlstring): def parseSection(section): - heading=section.getElementsByTagName('heading')[0] - type=heading.getAttribute('class') - header=getText(heading.childNodes) + type="" + header="" + for heading in section.getElementsByTagName('heading'): + type=heading.getAttribute('class') + header=getText(heading.childNodes) + + if type=="": # falls heading fehlt, pruefe ob erster par richtig + par=section.getElementsByTagName('par')[0] + type=par.getAttribute('class') + header=getText(par.childNodes) + #print section.childNodes pars=Evaluate('par',section) content=par2html(pars) @@ -165,19 +173,16 @@ def getText(nodelist): rc = u'' for node in nodelist: - print "HHHH" if node.nodeType == node.TEXT_NODE: #print "node",node #print "NODE",node.data.encode('utf-8','ignore'),"V" #print "HALII" try: try: - print "try1" #rc += node.data.encode('utf-8','ignore') rc += node.data except: - print "try2" #rc= node.data.encode('utf-8','ignore') rc=node.data except: @@ -189,7 +194,7 @@ def getText(nodelist): elif node.tagName =="inline": rc+=par2html([node]) elif node.attributes: - print "xlink?" + if 'xlink:type' in node.attributes.keys(): #is a xlink? rc +=xlink2html(node) #print "RWT",rc