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 2022/01/07 09:42:04 UTC
[royale-docs] branch master updated: typo
This is an automated email from the ASF dual-hosted git repository.
harbs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git
The following commit(s) were added to refs/heads/master by this push:
new 5203a44 typo
5203a44 is described below
commit 5203a4492e6be9ab07cc853b58cb0df221adb0c0
Author: Harbs <ha...@in-tools.com>
AuthorDate: Fri Jan 7 11:41:50 2022 +0200
typo
---
features/as3/xml.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/features/as3/xml.md b/features/as3/xml.md
index b79e536..2170bf9 100644
--- a/features/as3/xml.md
+++ b/features/as3/xml.md
@@ -47,7 +47,7 @@ The goal of E4X is to give an intuitive interface to read, traverse and filter X
E4X adds three basic operators. The dot (`.`) operator in E4X means "child" and the `.@` operator means "attribute". The `..` operator means descendent. So you can get all children with the name `child` by using `root.child` or an attribute by using `root.child.@name` `root..child` will return all descendents named "child" no matter how far down the hierarchy they are.
### Filtering
-E4X also allows filtering. Let's say you want to get only child who's name is "Bob". You can do that by using `root.(child.@name == "Bob)`. To help grasp the syntax, you can think of `.()` as a "filter function". The above expression in English would be "give me all children of root whose name attribute equals Bob". As you can see, the syntax is very concise, intuitive and quite powerful.
+E4X also allows filtering. Let's say you want to get only children who's name is "Bob". You can do that by using `root.(child.@name == "Bob)`. To help grasp the syntax, you can think of `.()` as a "filter function". The above expression in English would be "give me all children of root whose name attribute equals Bob". As you can see, the syntax is very concise, intuitive and quite powerful.
## Limitations
Because XML and E4X is not supported natively by the browser, some E4X code needs to be rewritten by the compiler. For this to work, the compiler needs to know that an object is XML. For this reason it's very important to be consistent about declaring XML types in Royale. Particular care should be taken if you have an array of XML objects to either use `Vector`, declare a local variable (i.e. `var item:XML = arr[i]`) or use function access instead of E4X syntax. To further clarify: `myUn [...]