Exemplo n.º 1
0
Arquivo: xp.py Projeto: spflieger/mbs
 def compile(s):
     try:
         parser = xpath.parser.XPath(xpath.parser.XPathScanner(str(s)))
         expr = parser.XPath()
     except xpath.yappsrt.SyntaxError as e:
         raise xpath.exceptions.XPathParseError(str(s), e.pos, e.msg)
     return expr
Exemplo n.º 2
0
 def __init__(self, expr):
     """Init docs.
     """
     try:
         parser = xpath.parser.XPath(xpath.parser.XPathScanner(str(expr)))
         self.expr = parser.XPath()
     except xpath.yappsrt.SyntaxError as e:
         raise XPathParseError(str(expr), e.pos, e.msg)