This is an automated email from the ASF dual-hosted git repository.
harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 5adf697 Fixed XMLList.toString()
5adf697 is described below
commit 5adf6974cbed9d7e25dfd7b4759bf3ceccc1d495
Author: Harbs <[email protected]>
AuthorDate: Mon Feb 19 00:05:24 2018 +0200
Fixed XMLList.toString()
---
frameworks/projects/XML/src/main/royale/XML.as | 2 ++
frameworks/projects/XML/src/main/royale/XMLList.as | 2 +-
manualtests/XMLTest/src/MyInitialView.mxml | 8 +++++++-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/frameworks/projects/XML/src/main/royale/XML.as
b/frameworks/projects/XML/src/main/royale/XML.as
index c151d2d..46cc802 100644
--- a/frameworks/projects/XML/src/main/royale/XML.as
+++ b/frameworks/projects/XML/src/main/royale/XML.as
@@ -238,6 +238,8 @@ package
xml = new XML();
xml.setNodeKind("text");
xml.setName(qname);
+ if(XML.ignoreWhitespace)
+ data = data.trim();
xml.setValue(data);
break;
case 4:
diff --git a/frameworks/projects/XML/src/main/royale/XMLList.as
b/frameworks/projects/XML/src/main/royale/XMLList.as
index b1a2009..ebf2e63 100644
--- a/frameworks/projects/XML/src/main/royale/XMLList.as
+++ b/frameworks/projects/XML/src/main/royale/XMLList.as
@@ -961,7 +961,7 @@ package
if(str)
retVal.push(str);
}
- return retVal.join("\n");
+ return retVal.join("");
}
/**
diff --git a/manualtests/XMLTest/src/MyInitialView.mxml
b/manualtests/XMLTest/src/MyInitialView.mxml
index 1734384..72e21a5 100644
--- a/manualtests/XMLTest/src/MyInitialView.mxml
+++ b/manualtests/XMLTest/src/MyInitialView.mxml
@@ -145,7 +145,13 @@ limitations under the License.
trace("moving to <newparent/>");
trace(childXML.toXMLString() + " is child of" + parent.toXMLString() +
"? " + (childXML.parent() == parent));
trace(childXML.toXMLString() + " is child of" +
newParent.toXMLString() + "? " + (childXML.parent() == newParent));
-
+ childXML = <Content> • <?ACE 7?>Some amazing content</Content>;
+ var childXMLStr:String = childXML.text();
+ trace(childXMLStr + " (should be) •Some amazing
content? " + (childXMLStr == "•Some amazing content"));
+ XML.ignoreWhitespace = false;
+ childXML = <Content> • <?ACE 7?>Some amazing content</Content>;
+ childXMLStr = childXML.text();
+ trace(childXMLStr + " (should be) \t• Some
amazing content? " + (childXMLStr == "\t• Some amazing content"));
var xmlString:String = xml.toXMLString();
var script:XML = xml..script[0].children()[0];
--
To stop receiving notification emails like this one, please contact
[email protected].