Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::config::validators::XmlNamespaceContextContainer Class Reference

List of all members.

Public Member Functions

String getNamespaceURI (String prefix)
String getPrefix (String namespaceURI)
Iterator< String > getPrefixes (String namespaceURI)
void addNamespace (String prefix, String uri)

Private Attributes

Map< String, String > prefixUriMap = new HashMap<String String>()

Detailed Description

Support class for XPath queries which allows to bind XML namespaces to prefixes, using javax.xml.xpath.XPath#setNamespaceContext(javax.xml.namespace.NamespaceContext). This is especially needed for XPath queries on XML documents that use an (unnamed) default namespace, for which an "artificial" prefix must be defined and communicated to the XPath engine, so that the XPath expression can use that prefix in order to match the default namespace.

This class with its method addNamespace(String, String) This method serves a similar purpose as jdom's org.jdom.xpath.XPath#addNamespace(String, String) method.

Implementation note: we only keep a map to quickly go from prefix to namespace, but not the other way around. According to http://xml.apache.org/xalan-j/xpath_apis.html#namespacecontext the XPath processor in Xalan never needs the methods that return prefixes, thus their performance does not matter at the moment.

Author:
hsommer


Member Function Documentation

void alma::acs::config::validators::XmlNamespaceContextContainer::addNamespace String  prefix,
String  uri
[inline]
 

Adds a prefix/namespace pair.

Parameters:
prefix 
uri 

String alma::acs::config::validators::XmlNamespaceContextContainer::getNamespaceURI String  prefix  )  [inline]
 

String alma::acs::config::validators::XmlNamespaceContextContainer::getPrefix String  namespaceURI  )  [inline]
 

See also:
javax.xml.namespace.NamespaceContext#getPrefix(java.lang.String)

Iterator<String> alma::acs::config::validators::XmlNamespaceContextContainer::getPrefixes String  namespaceURI  )  [inline]
 


Member Data Documentation

Map<String, String> alma::acs::config::validators::XmlNamespaceContextContainer::prefixUriMap = new HashMap<String String>() [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:52:22 2009 for ACS Java API by doxygen 1.3.8