You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ha...@apache.org on 2016/05/04 21:03:59 UTC

git commit: [flex-asjs] [refs/heads/develop] - Fixed XML.toString()

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 6835bd42e -> 2646884b0


Fixed XML.toString()


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/2646884b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/2646884b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/2646884b

Branch: refs/heads/develop
Commit: 2646884b0218e16509605f8971c2137325408a78
Parents: 6835bd4
Author: Harbs <ha...@in-tools.com>
Authored: Thu May 5 00:03:54 2016 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Thu May 5 00:03:54 2016 +0300

----------------------------------------------------------------------
 frameworks/projects/XML/src/main/flex/XML.as | 12 ++++++++++++
 manualtests/XMLTest/src/MyInitialView.mxml   |  1 +
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2646884b/frameworks/projects/XML/src/main/flex/XML.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/XML.as b/frameworks/projects/XML/src/main/flex/XML.as
index 0577abb..0c6d2d0 100644
--- a/frameworks/projects/XML/src/main/flex/XML.as
+++ b/frameworks/projects/XML/src/main/flex/XML.as
@@ -2078,6 +2078,7 @@ package
 		COMPILE::JS
 		public function toString():String
 		{
+			var i:int;
 			// text, comment, processing-instruction, attribute, or element
 			if(_nodeKind == "text" || _nodeKind == "attribute")
 				return _value;
@@ -2085,6 +2086,17 @@ package
 				return "";
 			if(_nodeKind == "processing-instruction")
 				return "";
+			if(this.hasSimpleContent())
+			{
+				var s:String = "";
+				for(i=0;i<_children.length;i++)
+				{
+					if(_children[i].nodeKind() == "comment" || _children[i].nodeKind() == "processing-instruction")
+						continue;
+					s = s + _children[i].toString();
+				}
+				return s;
+			}
 			return toXMLString();
 		}
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2646884b/manualtests/XMLTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/manualtests/XMLTest/src/MyInitialView.mxml b/manualtests/XMLTest/src/MyInitialView.mxml
index a60578c..b732fa3 100644
--- a/manualtests/XMLTest/src/MyInitialView.mxml
+++ b/manualtests/XMLTest/src/MyInitialView.mxml
@@ -139,6 +139,7 @@ trace(prod.childIndex());
                 list1 += list4
 //list1.concat(list4);
                 xml2.insertChildAfter(xml2.a,<a id="123"/>);
+                trace(xml2.toString());
                 xml2.a = list4;
                 xml2.a = <a id="123"/>;
                 xml2.a += <a id="456"/>;