Project

General

Profile

« Previous | Next » 

Revision 139

xml_dom.py: Changed all uses of name_of(node) to node.tagName

View differences:

scripts/lib/xml_func.py
51 51

  
52 52
def process(doc, node=None):
53 53
    if node == None: node = doc.documentElement
54
    name = xml_dom.name_of(node)
54
    name = node.tagName
55 55
    if name.startswith('_') and name in funcs: xml_dom.replace_with_text(doc,
56 56
        node, funcs[name](xml_dom.NodeTextEntryIter(node)))
57 57
    else:
scripts/lib/xml_dom.py
13 13

  
14 14
def unescape(str_): return HTMLParser().unescape(str_)
15 15

  
16
def name_of(node): return node.tagName
17

  
18 16
def get_id(node): return node.getAttribute('id')
19 17

  
20 18
def set_id(node, id_): node.setAttribute('id', id_)
......
93 91
    def curr(self):
94 92
        while True:
95 93
            child = self.iter_.curr()
96
            if is_text(child): return (name_of(child), value(child))
94
            if is_text(child): return (child.tagName, value(child))
97 95
            self.iter_.next()
98 96
    
99 97
    def next(self):
scripts/lib/db_xml.py
8 8
import util
9 9
import xml_dom
10 10

  
11
def name_of(node): return re.sub(r'^.*\.', r'', xml_dom.name_of(node))
11
def name_of(node): return re.sub(r'^.*\.', r'', node.tagName)
12 12

  
13 13
ptr_suffix = '_id'
14 14

  

Also available in: Unified diff