import exceptions

from _xpath import api, XPathContext, XPath
from exceptions import *

__all__ = ['find', 'findnode', 'findvalue', 'findvalues', 'XPathContext', 'XPath']
__all__.extend((x for x in dir(exceptions) if not x.startswith('_')))

@api
def find(expr, node, **kwargs):
    return XPath.get(expr).find(node, **kwargs)

@api
def findnode(expr, node, **kwargs):
    return XPath.get(expr).findnode(node, **kwargs)

@api
def findvalue(expr, node, **kwargs):
    return XPath.get(expr).findvalue(node, **kwargs)

@api
def findvalues(expr, node, **kwargs):
    return XPath.get(expr).findvalues(node, **kwargs)
