You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ka...@apache.org on 2011/09/23 10:15:01 UTC

svn commit: r1174581 - in /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml: URLRewriteMediatorFactory.java URLRewriteMediatorSerializer.java

Author: kasun
Date: Fri Sep 23 08:15:01 2011
New Revision: 1174581

URL: http://svn.apache.org/viewvc?rev=1174581&view=rev
Log:
Applying the fix for SYNAPSE-767

Modified:
    synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorFactory.java
    synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializer.java

Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorFactory.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorFactory.java?rev=1174581&r1=1174580&r2=1174581&view=diff
==============================================================================
--- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorFactory.java (original)
+++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorFactory.java Fri Sep 23 08:15:01 2011
@@ -20,7 +20,6 @@
 package org.apache.synapse.config.xml;
 
 import org.apache.synapse.Mediator;
-import org.apache.synapse.util.xpath.SynapseXPath;
 import org.apache.synapse.commons.evaluators.Evaluator;
 import org.apache.synapse.commons.evaluators.EvaluatorException;
 import org.apache.synapse.commons.evaluators.config.EvaluatorFactoryFinder;
@@ -136,15 +135,16 @@ public class URLRewriteMediatorFactory e
         String value = actionElement.getAttributeValue(ATT_VALUE);
         String xpath = actionElement.getAttributeValue(ATT_XPATH);
         String type = actionElement.getAttributeValue(ATT_TYPE);
-
+        QName xpath_Q  = new QName(XMLConfigConstants.NULL_NAMESPACE, "xpath");
+        
         if (value == null && xpath == null && !ACTION_REMOVE.equals(type)) {
             handleException("value or xpath attribute is required on the action element");
         }
 
         RewriteAction action = new RewriteAction();
         if (xpath != null) {
-            try {
-                action.setXpath(new SynapseXPath(xpath));
+            try {        
+            	action.setXpath(SynapseXPathFactory.getSynapseXPath(actionElement, xpath_Q));
             } catch (JaxenException e) {
                 handleException("Error while parsing the XPath expression: " + xpath, e);
             }

Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializer.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializer.java?rev=1174581&r1=1174580&r2=1174581&view=diff
==============================================================================
--- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializer.java (original)
+++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializer.java Fri Sep 23 08:15:01 2011
@@ -94,8 +94,8 @@ public class URLRewriteMediatorSerialize
         OMElement action = fac.createOMElement("action", synNS);
         if (a.getValue() != null) {
             action.addAttribute("value", a.getValue(), null);
-        } else if (a.getXpath() != null) {
-            action.addAttribute("xpath", a.getXpath().toString(), null);
+        } else if (a.getXpath() != null) {         
+            SynapseXPathSerializer.serializeXPath(a.getXpath(), action, "xpath");
         }
 
         if (a.getRegex() != null) {