tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdan...@apache.org
Subject svn commit: r957102 - in /tuscany/sca-java-2.x/trunk/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java
Date Wed, 23 Jun 2010 04:03:27 GMT
Author: bdaniel
Date: Wed Jun 23 04:03:27 2010
New Revision: 957102

URL: http://svn.apache.org/viewvc?rev=957102&view=rev
Log:
Remove NameSpaceContextImpl class reference from assembly-xml

Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
    tuscany/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java

Modified: tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java?rev=957102&r1=957101&r2=957102&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
Wed Jun 23 04:03:27 2010
@@ -259,10 +259,11 @@ public class PolicySetProcessor extends 
     		if ( !prefix.equals(XMLConstants.DEFAULT_NS_PREFIX))
     			return prefix;
     	}
+    	
     	// We have to have some prefix here to use before the function name. Otherwise the 
     	// XPathFunctionResolver will never be called. 
-    	NamespaceContextImpl nsImpl = (NamespaceContextImpl) nsContext;
-    	nsImpl.register("sca_internal", SCA11_NS);
+    	xpathHelper.registerPrefix("sca_internal", SCA11_NS, nsContext);
+    
     	return "sca_internal";
 	}
 

Modified: tuscany/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java?rev=957102&r1=957101&r2=957102&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java
Wed Jun 23 04:03:27 2010
@@ -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



Mime
View raw message