protected void prepare() throws Exception {
// Create an object to resolve namespace prefixes.
// XPath namespaces are resolved from the input root node's
// document element if it is a root node, or else the current root node.
prefixResolver = namespace != null ? new PrefixResolverDefault (namespace):
new PrefixResolverDefault (rootNode);
// parse the specified Query-String and build an Parse-Tree
parser.initXPath (xpath, qstring, prefixResolver);
hasChanged = false;