Esempio n. 1
0
 def __handle_a__(self, xmlnode, dstree, dsnode):
     value = util.parseValueFrom(xmlnode)
     if xmlnode.get(ABBR) != ABBR_TRUE:
         value = value + ' '
     
     self.abstractHandler.handleReplace(dstree, dsnode, value)
     return self.handleIndent(dsnode, xmlnode)
Esempio n. 2
0
 def __handle_title__(self, xmlnode, dstree, dsnode):
     # Assumes document node
     if DocumentStructure.getLevel(dsnode) != DocumentStructure.DOCUMENT:
         raise Exception, "Unexpected level" 
     
     DocumentStructure.setNode(dsnode, value=util.parseValueFrom(xmlnode))
     return dsnode
Esempio n. 3
0
 def __handle_caption__(self, xmlnode, dstree, dsnode):
     dsnode = self.prepareNode(dstree, dsnode, DocumentStructure.PARAGRAPH)
     value = util.parseValueFrom(xmlnode)
     
     if DocumentStructure.getLevel(dsnode) == DocumentStructure.PARAGRAPH:
         value = util.ensureEndsInPeriod(value)
             
     self.abstractHandler.handleReplace(dstree, dsnode, value)
     return self.handleIndent(dsnode, xmlnode)
Esempio n. 4
0
 def __handle_abbr__(self, xmlnode, dstree, dsnode):
     # Tag subtree as ABBR
     xmlchildtree = etree.ElementTree(xmlnode)
     xmlchildlastnode = None
     for xmlchildnode in xmlchildtree.iter(tag=etree.Element):
         xmlchildnode.set(ABBR, ABBR_TRUE)
         xmlchildlastnode = xmlchildnode
     xmlchildlastnode.set(ABBR, ABBR_FALSE)
             
     dsnode = self.prepareNode(dstree, dsnode, DocumentStructure.PARAGRAPH)
     self.abstractHandler.handleReplace(dstree, dsnode, util.parseValueFrom(xmlnode) + ' ')
     return self.handleIndent(dsnode, xmlnode)
Esempio n. 5
0
 def __handle_ins__(self, xmlnode, dstree, dsnode):
     dsnode = self.prepareNode(dstree, dsnode, DocumentStructure.PARAGRAPH)
     self.abstractHandler.handleReplace(dstree, dsnode, util.parseValueFrom(xmlnode))
     return self.handleIndent(dsnode, xmlnode)
Esempio n. 6
0
 def __handle_li__(self, xmlnode, dstree, dsnode):
     level = DocumentStructure.TEXT_CLAUSE
     value = util.parseValueFrom(xmlnode)
     dsnode = self.prepareNode(dstree, dsnode, level)
     dsnode = dstree.addNode(dsnode, level, value = value)
     return self.handleIndent(dsnode, xmlnode)