diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/common-xml/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java b/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java index a65bd5fe15..d48f010c55 100644 --- a/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java +++ b/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java @@ -91,11 +91,23 @@ public class XPathHelper { if (namespace != null && !XMLConstants.NULL_NS_URI.equals(namespace)) { nsContext.register(prefix, namespace); } - } + } + return nsContext; } /** + * Registers a prefix in an existing NamespaceContext + * @param prefix + * @param namespace + * @param context + */ + public void registerPrefix(String prefix, String namespace, NamespaceContext context) { + NamespaceContextImpl nsContext = (NamespaceContextImpl) context; + nsContext.register(prefix, namespace); + } + + /** * Parse the XPath expression to collect all the prefixes for namespaces * @param expression * @return A collection of prefixes |