Public Member Functions

alma.acs.config.validators.XmlNamespaceContextContainer Class Reference

Inherits javax::xml::namespace::NamespaceContext.

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)

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 
)

Adds a prefix/namespace pair.

Parameters:
prefix 
uri 

Referenced by alma.acs.config.validators.ConfigFileRedeemerXml._isNotAConfigFile().

String alma.acs.config.validators.XmlNamespaceContextContainer.getNamespaceURI ( String  prefix  ) 
String alma.acs.config.validators.XmlNamespaceContextContainer.getPrefix ( String  namespaceURI  ) 
See also:
javax.xml.namespace.NamespaceContext.getPrefix(java.lang.String)

References alma.acs.config.validators.XmlNamespaceContextContainer.getPrefixes().

Iterator<String> alma.acs.config.validators.XmlNamespaceContextContainer.getPrefixes ( String  namespaceURI  ) 

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties