You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2018/02/20 09:39:45 UTC
[royale-asjs] branch develop updated (6a039fb -> aacd60b)
This is an automated email from the ASF dual-hosted git repository.
harbs pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.
from 6a039fb add license headers to new ASDoc classes to fix maven build
new 5fe8ee8 Fix valueOf() of empty XML elements
new aacd60b Fixed toXMLString() of CDATA sections
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
frameworks/projects/XML/src/main/royale/XML.as | 6 ++++++
manualtests/XMLTest/src/MyInitialView.mxml | 16 +++++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
--
To stop receiving notification emails like this one, please contact
harbs@apache.org.
[royale-asjs] 02/02: Fixed toXMLString() of CDATA sections
Posted by ha...@apache.org.
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
commit aacd60bcb54d989f56fab07517ccfdda3c8831f0
Author: Harbs <ha...@in-tools.com>
AuthorDate: Tue Feb 20 11:39:37 2018 +0200
Fixed toXMLString() of CDATA sections
---
frameworks/projects/XML/src/main/royale/XML.as | 4 ++++
manualtests/XMLTest/src/MyInitialView.mxml | 16 +++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/frameworks/projects/XML/src/main/royale/XML.as b/frameworks/projects/XML/src/main/royale/XML.as
index 4934521..b13fada 100644
--- a/frameworks/projects/XML/src/main/royale/XML.as
+++ b/frameworks/projects/XML/src/main/royale/XML.as
@@ -2510,8 +2510,12 @@ package
if(prettyPrinting)
{
var v:String = trimXMLWhitespace(_value);
+ if(name().localName == "#cdata-section")
+ return indent + v;
return indent + escapeElementValue(v);
}
+ if(name().localName == "#cdata-section")
+ return _value;
return escapeElementValue(_value);
}
if(this.nodeKind() == "attribute")
diff --git a/manualtests/XMLTest/src/MyInitialView.mxml b/manualtests/XMLTest/src/MyInitialView.mxml
index 72e21a5..1e42c42 100644
--- a/manualtests/XMLTest/src/MyInitialView.mxml
+++ b/manualtests/XMLTest/src/MyInitialView.mxml
@@ -152,7 +152,21 @@ limitations under the License.
childXML = <Content> • <?ACE 7?>Some amazing content</Content>;
childXMLStr = childXML.text();
trace(childXMLStr + " (should be) \t• Some amazing content? " + (childXMLStr == "\t• Some amazing content"));
-
+ XML.ignoreWhitespace = true;
+ XML.prettyPrinting = false;
+ var content:XML = new XML(
+'<root>' +
+' <content><![CDATA[<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>' +
+'<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27 ">' +
+' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' +
+' <rdf:Description rdf:about=""/>' +
+' </rdf:RDF>' +
+'</x:xmpmeta>' +
+'<?xpacket end="r"?>]'+']></content>' +
+'</root>');
+var contentStr:String = content.toXMLString();
+var correctStr:String = '<root><content><![CDATA[<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27 "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about=""/> </rdf:RDF></x:xmpmeta><?xpacket end="r"?>]'+']></content></root>';
+trace("content with cdata works? " + (contentStr == correctStr));
var xmlString:String = xml.toXMLString();
var script:XML = xml..script[0].children()[0];
var kind:String = script.nodeKind();
--
To stop receiving notification emails like this one, please contact
harbs@apache.org.
[royale-asjs] 01/02: Fix valueOf() of empty XML elements
Posted by ha...@apache.org.
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
commit 5fe8ee8730cc509f6d03b6e756076bed76af6ec4
Author: Harbs <ha...@in-tools.com>
AuthorDate: Tue Feb 20 11:39:18 2018 +0200
Fix valueOf() of empty XML elements
---
frameworks/projects/XML/src/main/royale/XML.as | 2 ++
1 file changed, 2 insertions(+)
diff --git a/frameworks/projects/XML/src/main/royale/XML.as b/frameworks/projects/XML/src/main/royale/XML.as
index 46cc802..4934521 100644
--- a/frameworks/projects/XML/src/main/royale/XML.as
+++ b/frameworks/projects/XML/src/main/royale/XML.as
@@ -2644,6 +2644,8 @@ package
override public function valueOf():*
{
var str:String = this.toString();
+ if(str == "")
+ return str;
var num:Number = Number(str);
return isNaN(num) ? str : num;
}
--
To stop receiving notification emails like this one, please contact
harbs@apache.org.