#include <kdebug.h>

#include <dom/dom_node.h>
#include <dom/dom_string.h>

#include "xpath_context.h"
#include "xpath_expression.h"
#include "xpath_query.h"

namespace XPath {

Value *Query::select( const QString &exp, const DOM::Node &node )
{
    return select( exp, Context(node) );
}

Value *Query::select( const QString &exp, const Context &context )
{
    kdDebug() << "Query::select( '" << exp << "' ) with context element '"
	      << context.current().nodeName().string() << "'" << endl;

    QueryState state( *this, context );
    FunctionCall fc( FunctionCall::FunctionPosition );
    return fc.evaluate( &state );
}

}; // namespace XPath

// Local Variables:
// c-basic-offset: 4
// End:
