flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/e4x] - First working E4X test
Date Sun, 10 Apr 2016 12:53:12 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/e4x ff4cf6920 -> 5d2d0dd43


First working E4X test


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

Branch: refs/heads/e4x
Commit: 5d2d0dd43410072734f7ae164f1a487260d471ad
Parents: ff4cf69
Author: Harbs <harbs@in-tools.com>
Authored: Sun Apr 10 15:53:07 2016 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Sun Apr 10 15:53:07 2016 +0300

----------------------------------------------------------------------
 frameworks/projects/XML/src/main/flex/QName.as |  8 ++++---
 frameworks/projects/XML/src/main/flex/XML.as   | 23 ++++++++++++++-------
 manualtests/XMLTest/src/MyInitialView.mxml     |  5 +++--
 3 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5d2d0dd4/frameworks/projects/XML/src/main/flex/QName.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/QName.as b/frameworks/projects/XML/src/main/flex/QName.as
index bfd7b40..c6886aa 100644
--- a/frameworks/projects/XML/src/main/flex/QName.as
+++ b/frameworks/projects/XML/src/main/flex/QName.as
@@ -57,11 +57,13 @@ package
 				if(localNameVal)
 					_localName = localNameVal.toString();
 			}
+			else if(localNameVal)
+			{
+				_localName = localNameVal;
+			}
 			else if (qNameOrUri && qNameOrUri.toString())
 			{
-				_uri = qNameOrUri.toString();
-				if(localNameVal)
-					_localName = localNameVal;
+				_localName = qNameOrUri.toString();
 			}
 		}
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5d2d0dd4/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 86a3ed1..b2222b6 100644
--- a/frameworks/projects/XML/src/main/flex/XML.as
+++ b/frameworks/projects/XML/src/main/flex/XML.as
@@ -329,6 +329,10 @@ package
 				var node:Element = doc.childNodes[0];
 				_version = doc.xmlVersion;
 				_encoding = doc.xmlEncoding;
+				_name = new QName();
+				_name.prefix = node.prefix;
+				_name.uri = node.namespaceURI;
+				_name.localName = node.localName;
 				iterateElement(node,this);
 				normalize();
 			}
@@ -2257,16 +2261,19 @@ package
 			//attributes and namespace declarations... (15-16)
 			for(i=0;i<declarations.length;i++)
 			{
-				strArr.push(" xmlns");
-				if(declarations[i].prefix)
+				var decVal:String = escapeAttributeValue(declarations[i].uri);
+				if(decVal)
 				{
-					strArr.push(":");
-					strArr.push(declarations[i].prefix);
+					strArr.push(" xmlns");
+					if(declarations[i].prefix)
+					{
+						strArr.push(":");
+						strArr.push(declarations[i].prefix);
+					}
+					strArr.push('="');
+					strArr.push(decVal);
+					strArr.push('"');
 				}
-				strArr.push('="');
-				strArr.push(escapeAttributeValue(declarations[i].uri));
-				strArr.push('"');
-
 			}
 			for(i=0;i<_attributes.length;i++)
 			{

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5d2d0dd4/manualtests/XMLTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/manualtests/XMLTest/src/MyInitialView.mxml b/manualtests/XMLTest/src/MyInitialView.mxml
index c611565..8d2fff5 100644
--- a/manualtests/XMLTest/src/MyInitialView.mxml
+++ b/manualtests/XMLTest/src/MyInitialView.mxml
@@ -46,8 +46,9 @@ limitations under the License.
                 var j:int;
                 var m:int;
                 var xml1:XML = <foo baz="true"/>;
-                trace(xml1);
-                trace(xml1.baz);
+                trace(xml1.toXMLString());
+                var baz:XMLList = xml1.@baz;
+                trace(xml1.@baz.toString());
 
             }
 		]]>


Mime
View raw message