org.apache.synapse.config.xml
Class OMElementUtils

java.lang.Object
  extended by org.apache.synapse.config.xml.OMElementUtils

public class OMElementUtils
extends Object

Holds Axiom utility methods used by Synapse


Constructor Summary
OMElementUtils()
           
 
Method Summary
static void addNameSpaces(XPath xpath, OMElement elem, org.apache.commons.logging.Log log)
          Add the namespace declarations of a given OMElement to the namespace context of an XPath expression.
static String getNameSpaceWithPrefix(String prefix, OMElement elem)
          Return the namespace with the given prefix, using the given element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMElementUtils

public OMElementUtils()
Method Detail

getNameSpaceWithPrefix

public static String getNameSpaceWithPrefix(String prefix,
                                            OMElement elem)
Return the namespace with the given prefix, using the given element

Parameters:
prefix - the prefix looked up
elem - the source element to use
Returns:
the namespace which maps to the prefix or null

addNameSpaces

public static void addNameSpaces(XPath xpath,
                                 OMElement elem,
                                 org.apache.commons.logging.Log log)
Add the namespace declarations of a given OMElement to the namespace context of an XPath expression. Typically this method is used with an XPath expression appearing in an attribute of the given element.

Note that the default namespace is explicitly excluded and not added to the namespace context. This implies that XPath expressions appearing in Synapse configuration files follow the same rule as in XSL style sheets. Indeed, the XSLT specification defines the namespace context of an XPath expression as follows:

the set of namespace declarations are those in scope on the element which has the attribute in which the expression occurs; [...] the default namespace (as declared by xmlns) is not part of this set

Parameters:
xpath -
elem -
log -


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.