def testAltNewline():
    str = '<?xml version="1.0" ?>\n<a b="c"/>\n'
    dom = parseString(str)
    domstr = dom.toprettyxml(newl="\r\n")
    dom.unlink()
    confirm(domstr == str.replace("\n", "\r\n"))
Пример #2
0
def testAltNewline():
    str = '<?xml version="1.0" ?>\n<a b="c"/>\n'
    dom = parseString(str)
    domstr = dom.toprettyxml(newl="\r\n")
    dom.unlink()
    confirm(domstr == str.replace("\n", "\r\n"))
Пример #3
0
			# add notes
			if thesis["note_title"] != None and len(thesis["note_title"]) > 0:
				newRef = int(thesis["refid"][3:])
				newRef += 1
				noteRef = "ref" + str(newRef)
				# add note 
				note = dom.createElement("odd")
				note.attributes["id"] = noteRef
				c.appendChild(note)
				#create note title
				head = dom.createElement("head")
				head.appendChild(dom.createTextNode(thesis["note_title"]))
				note.appendChild(head)
				#create note content
				p = dom.createElement("p")
				p.appendChild(dom.createTextNode(thesis["note_text"]))
				note.appendChild(p)

print dom.toprettyxml().encode('utf-8')


# spreadsheet is the cannonical representation of the thesis objects 
# thesis entries will be merged with the spreadsheet on name and date 
# another script will need to be added that iterates through the 
# archive db theses, creates a dict of the archive thesis record, 
# iterate through the subs and inject content into the approproate xml