Package stocks3 :: Package parsers :: Module xml
[hide private]
[frames] | no frames]

Source Code for Module stocks3.parsers.xml

 1  # -*- coding: utf-8 -*- 
 2   
 3  u""" 
 4  Базовый класс для всех XML-парсеров. 
 5  """ 
 6   
 7  __author__ = "Zasimov Alexey" 
 8  __email__ = "zasimov-a@yandex-team.ru" 
 9   
10   
11  from stocks3.core.parser import Parser 
12  from stocks3.core.config import parseXML 
13  from stocks3.core.place import FilePlace 
14   
15   
16 -class XMLParser(Parser):
17 18 places = [FilePlace] 19
20 - def __init__(self, tree, node):
21 Parser.__init__(self, tree, node) 22 self.dataTree = None 23 self.dataRoot = None
24
25 - def parse(self, place):
26 Parser.parse(self, place) 27 self.dataTree = parseXML(place.filename) 28 self.dataRoot = self.dataTree.getroot()
29
30 - def findall(self, path):
31 return self.dataTree.findall(path)
32