tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r957347 - /tuscany/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/xpath/XPathHelper.java
Date Wed, 23 Jun 2010 21:08:22 GMT
Author: rfeng
Date: Wed Jun 23 21:08:22 2010
New Revision: 957347

URL: http://svn.apache.org/viewvc?rev=957347&view=rev
Log:
Refactor the default sca namespace binding

Modified:
    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/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=957347&r1=957346&r2=957347&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 21:08:22 2010
@@ -86,13 +86,18 @@ public class XPathHelper {
     public NamespaceContext getNamespaceContext(String expression, NamespaceContext context)
{
         NamespaceContextImpl nsContext = new NamespaceContextImpl(null);
 
+        boolean found = false;
         for (String prefix : getPrefixes(expression)) {
             String namespace = context.getNamespaceURI(prefix);
             if (namespace != null && !XMLConstants.NULL_NS_URI.equals(namespace))
{
                 nsContext.register(prefix, namespace);
+                found = true;
             }
-        }    	
-    	
+        }
+        
+        if(!found) {
+            nsContext.register("__sca", "http://docs.oasis-open.org/ns/opencsa/sca/200912");
+        }
         return nsContext;
     }
 



Mime
View raw message