001 /*
002 * Copyright (c) 2004 World Wide Web Consortium,
003 *
004 * (Massachusetts Institute of Technology, European Research Consortium for
005 * Informatics and Mathematics, Keio University). All Rights Reserved. This
006 * work is distributed under the W3C(r) Software License [1] in the hope that
007 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
008 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
009 *
010 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
011 */
012
013 package org.w3c.dom.xpath;
014
015 /**
016 * The <code>XPathNSResolver</code> interface permit <code>prefix</code>
017 * strings in the expression to be properly bound to
018 * <code>namespaceURI</code> strings. <code>XPathEvaluator</code> can
019 * construct an implementation of <code>XPathNSResolver</code> from a node,
020 * or the interface may be implemented by any application.
021 * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
022 */
023 public interface XPathNSResolver {
024 /**
025 * Look up the namespace URI associated to the given namespace prefix. The
026 * XPath evaluator must never call this with a <code>null</code> or
027 * empty argument, because the result of doing this is undefined.
028 * @param prefix The prefix to look for.
029 * @return Returns the associated namespace URI or <code>null</code> if
030 * none is found.
031 */
032 public String lookupNamespaceURI(String prefix);
033
034 }