You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ve...@apache.org on 2009/03/19 23:21:38 UTC
svn commit: r756237 -
/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPath.java
Author: veithen
Date: Thu Mar 19 22:21:38 2009
New Revision: 756237
URL: http://svn.apache.org/viewvc?rev=756237&view=rev
Log:
SynapseXPath: added the constructors from AXIOMXPath that were introduced in Axiom 1.2.8.
Modified:
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPath.java
Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPath.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPath.java?rev=756237&r1=756236&r2=756237&view=diff
==============================================================================
--- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPath.java (original)
+++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/xpath/SynapseXPath.java Thu Mar 19 22:21:38 2009
@@ -19,6 +19,8 @@
package org.apache.synapse.util.xpath;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.llom.OMDocumentImpl;
@@ -91,6 +93,35 @@
super(xpathString);
}
+ /**
+ * Construct an XPath expression from a given string and initialize its
+ * namespace context based on a given element.
+ *
+ * @param element The element that determines the namespace context of the
+ * XPath expression. See {@link #addNamespaces(OMElement)}
+ * for more details.
+ * @param xpathExpr the string representation of the XPath expression.
+ * @throws JaxenException if there is a syntax error while parsing the expression
+ * or if the namespace context could not be set up
+ */
+ public SynapseXPath(OMElement element, String xpathExpr) throws JaxenException {
+ super(element, xpathExpr);
+ }
+
+ /**
+ * Construct an XPath expression from a given attribute.
+ * The string representation of the expression is taken from the attribute
+ * value, while the attribute's owner element is used to determine the
+ * namespace context of the expression.
+ *
+ * @param attribute the attribute to construct the expression from
+ * @throws JaxenException if there is a syntax error while parsing the expression
+ * or if the namespace context could not be set up
+ */
+ public SynapseXPath(OMAttribute attribute) throws JaxenException {
+ super(attribute);
+ }
+
public static SynapseXPath parseXPathString(String xPathStr) throws JaxenException {
if (xPathStr.indexOf('{') == -1) {
return new SynapseXPath(xPathStr);