001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018 /*
019 * $Id: XPathNSResolverImpl.java 1225426 2011-12-29 04:13:08Z mrglavas $
020 */
021
022 package org.apache.xpath.domapi;
023
024 import org.apache.xml.utils.PrefixResolverDefault;
025 import org.w3c.dom.Node;
026 import org.w3c.dom.xpath.XPathNSResolver;
027
028 /**
029 *
030 * The class provides an implementation XPathNSResolver according
031 * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
032 *
033 * <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>.</p>
034 *
035 * <p>The <code>XPathNSResolver</code> interface permit <code>prefix</code>
036 * strings in the expression to be properly bound to
037 * <code>namespaceURI</code> strings. <code>XPathEvaluator</code> can
038 * construct an implementation of <code>XPathNSResolver</code> from a node,
039 * or the interface may be implemented by any application.</p>
040 *
041 * @see org.w3c.dom.xpath.XPathNSResolver
042 * @xsl.usage internal
043 */
044 class XPathNSResolverImpl extends PrefixResolverDefault implements XPathNSResolver {
045
046 /**
047 * Constructor for XPathNSResolverImpl.
048 * @param xpathExpressionContext
049 */
050 public XPathNSResolverImpl(Node xpathExpressionContext) {
051 super(xpathExpressionContext);
052 }
053
054 /**
055 * @see org.w3c.dom.xpath.XPathNSResolver#lookupNamespaceURI(String)
056 */
057 public String lookupNamespaceURI(String prefix) {
058 return super.getNamespaceForPrefix(prefix);
059 }
060
061 }