svn commit r15868 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit r15868 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

svn-9
Author: keith
Date: Sun Apr 20 22:03:50 2008
New Revision: 15868

Log:

Not adding a redundant wrapper element for XMLList
 


Modified:
   trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java

Modified: trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java
==============================================================================
--- trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java (original)
+++ trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java Sun Apr 20 22:03:50 2008
@@ -1182,20 +1182,16 @@
         } else if (jsObject instanceof XMLList) {
             XMLList list = (XMLList) jsObject;
             OMNode[] omNodes = list.getAxiomFromXML();
-            if (omNodes.length == 1) {
-                element.addChild(omNodes[0]);
-            } else if (omNodes.length == 0) {
+            if (omNodes.length == 0) {
                 return element;
             } else {
-                OMElement wrapperElement = fac.createOMElement("return", null);
                 for (int i = 0; i < omNodes.length; i++) {
-                    wrapperElement.addChild(omNodes[i]);
+                    element.addChild(omNodes[i]);
                 }
-                element.addChild(wrapperElement);
                 if (addTypeInfo) {
-                    wrapperElement.addAttribute("type", "xmlList", namespace);
-                    wrapperElement.declareNamespace(xsNamespace);
-                    wrapperElement.addAttribute("type", "xs:anyType", xsiNamespace);
+                    element.addAttribute("type", "xmlList", namespace);
+                    element.declareNamespace(xsNamespace);
+                    element.addAttribute("type", "xs:anyType", xsiNamespace);
                 }
             }
         } else {

_______________________________________________
Wsf-javascript-dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/wsf-javascript-dev