|
|
| version 1.3, 2004/08/11 13:02:04 | version 1.6.2.2, 2012/01/09 07:33:31 |
|---|---|
| Line 3 from sys import argv | Line 3 from sys import argv |
| import string | import string |
| import xml.dom.minidom | import xml.dom.minidom |
| import Ft.Xml.XLink.Processor | #import Ft.Xml.XLink.Processor |
| import Ft.Xml.XLink.XLinkElements | #import Ft.Xml.XLink.XLinkElements |
| # | |
| from Ft.Xml import XPath | #from Ft.Xml import XPath |
| from Ft.Xml.XPath import Evaluate | #from Ft.Xml.XPath import Evaluate |
| from Ft.Xml.XLink import XLINK_NAMESPACE | #from Ft.Xml.XLink import XLINK_NAMESPACE |
| from Ft.Xml.XLink import XLinkElements | #from Ft.Xml.XLink import XLinkElements |
| #from Ft.Xml.Domlette import NonvalidatingReader,InputSource | #from Ft.Xml.Domlette import NonvalidatingReader,InputSource |
| #from Ft.Xml import EMPTY_NAMESPACE | #from Ft.Xml import EMPTY_NAMESPACE |
| from Ft.Lib import Uri | |
| xml2html={'WEB_normal':('<p>','</p>'),'Normal':('<p>','</p>'),'WEB_picture':('<p>','</p>'),'WEB_figuretitle':('<i>','</i>'),'WEB_bibliography':('<p><i>','</i></p>'),'Web_kursiv':('<i>','</i>'),'WEB_kursiv':('<i>','</i>'),'WEB_hyperlink':('',''),'Hyperlink':('','')} | #from Ft.Lib import Uri |
| xml2html={'WEB_normal':('<p>','</p>'),'Normal':('<p>','</p>'),'WEB_picture':('<p class=\"picture\">','</p>'),'WEB_figuretitle':('<p class=\"picturetitle\">','</p>'),'WEB_bibliography':('<p><i>','</i></p>'),'Web_kursiv':('<i>','</i>'),'WEB_kursiv':('<i>','</i>'),'WEB_hyperlink':('',''),'Hyperlink':('','')} | |
| def addToDict(dict,name,value): | def addToDict(dict,name,value): |
| if name=="": | if name=="": |
| Line 53 def proj2hash(xmlstring): | Line 54 def proj2hash(xmlstring): |
| sec=parseSection(section) | sec=parseSection(section) |
| if sec[0]=="WEB_project_header": # Sonderfall project | if sec[0]=="WEB_project_header": # Sonderfall project |
| addToDict(list,'WEB_project_header',sec[1]) # store title | addToDict(list,'WEB_project_header',sec[1]) # store title |
| addToDict(list,'WEB_project_description',sec[2]) #store description | addToDict(list,'WEB_project_description',sec[2]) #store description |
| else: # no information in heading | else: # no information in heading |
| addToDict(list,sec[0],sec[2]) | addToDict(list,sec[0],sec[2]) |
| #evaluate higher level sections | #evaluate higher level sections |
| Line 78 def proj2hash(xmlstring): | Line 81 def proj2hash(xmlstring): |
| def parseSection(section): | def parseSection(section): |
| type="" | type="" |
| header="" | header="" |
| for heading in section.getElementsByTagName('heading'): | for heading in section.childNodes: |
| if getattr(heading,'tagName','')=="heading": | |
| type=heading.getAttribute('class') | type=heading.getAttribute('class') |
| header=getText(heading.childNodes) | header=getText(heading.childNodes) |