axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r738057 - /webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
Date Tue, 27 Jan 2009 11:26:03 GMT
Author: veithen
Date: Tue Jan 27 11:26:02 2009
New Revision: 738057

URL: http://svn.apache.org/viewvc?rev=738057&view=rev
Log:
Corrected the behavior of the getTextContent, getElementsByTagName and getElementsByTagNameNS
methods in SOAPElement.

Modified:
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java?rev=738057&r1=738056&r2=738057&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
Tue Jan 27 11:26:02 2009
@@ -607,14 +607,14 @@
       * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String)
       */
     public NodeList getElementsByTagName(String name) {
-        return element.getElementsByTagName(name);
+        return toSAAJNodeList(element.getElementsByTagName(name));
     }
 
     /* (non-Javadoc)
       * @see org.w3c.dom.Element#getElementsByTagNameNS(java.lang.String, java.lang.String)
       */
     public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
-        return element.getElementsByTagNameNS(namespaceURI, localName);
+        return toSAAJNodeList(element.getElementsByTagNameNS(namespaceURI, localName));
     }
 
     /* (non-Javadoc)
@@ -760,6 +760,15 @@
         return null;
     }
 
+    public String getTextContent() throws DOMException {
+        return element.getTextContent();
+    }
+
+    @Override
+    protected Object clone() throws CloneNotSupportedException {
+        // TODO Auto-generated method stub
+        return super.clone();
+    }
 
     public org.w3c.dom.Node getFirstChild() {
         return toSAAJNode(element.getFirstChild());
@@ -796,14 +805,16 @@
         return toSAAJNode(element.getPreviousSibling());
     }
 
-    public NodeList getChildNodes() {
-        NodeList childNodes = element.getChildNodes();
-        NodeListImpl nodes = new NodeListImpl();
-
-        for (int i = 0; i < childNodes.getLength(); i++) {
-            nodes.addNode(toSAAJNode(childNodes.item(i)));
+    private NodeList toSAAJNodeList(NodeList nodes) {
+        NodeListImpl result = new NodeListImpl();
+        for (int i = 0; i < nodes.getLength(); i++) {
+            result.addNode(toSAAJNode(nodes.item(i)));
         }
-        return nodes;
+        return result;
+    }
+
+    public NodeList getChildNodes() {
+        return toSAAJNodeList(element.getChildNodes());
     }
 
     public boolean hasChildNodes() {



Mime
View raw message