-
-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
327 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package { | ||
import flash.display.MovieClip; | ||
import flash.xml.XMLNode; | ||
|
||
|
||
public class Test extends MovieClip { | ||
|
||
|
||
public function Test() { | ||
XML.prettyPrinting = false; | ||
|
||
var xml: XML = | ||
<root> | ||
<outer> | ||
<top xmlns:topns="https://example.org/top" topns:test="top with topns"> | ||
<middle xmlns:middlens="https://example.org/middle" topns:test="middle with topns"> | ||
<bottom xmlns:bottomns="https://example.org/bottom" topns:test="bottom with topns" bottomns:test="bottom with bottomns"/> | ||
<topns:namespacedTopnsSibling /> | ||
<middlens:namespacedMiddlensSibling /> | ||
</middle> | ||
</top> | ||
</outer> | ||
</root>; | ||
|
||
dump(xml); | ||
|
||
trace(""); | ||
trace("top.addNamespace(new Namespace(\"topns\", \"https://example.org/top/but/replaced\"))"); | ||
xml.outer[0].top[0].addNamespace(new Namespace("topns", "https://example.org/top/but/replaced")); | ||
trace("top.addNamespace(new Namespace(\"middlens\", \"https://example.org/middle/but/replaced\"))"); | ||
xml.outer[0].top[0].addNamespace(new Namespace("middlens", "https://example.org/middle/but/replaced")); | ||
trace("top.addNamespace(new Namespace(\"newns\", \"https://example.org/new\"))"); | ||
xml.outer[0].top[0].addNamespace(new Namespace("newns", "https://example.org/new")); | ||
trace("top.addNamespace(new Namespace(undefined, \"https://example.org/undefined\"))"); | ||
xml.outer[0].top[0].addNamespace(new Namespace(undefined, "https://example.org/undefined")); | ||
|
||
trace(""); | ||
dump(xml); | ||
trace(""); | ||
trace(""); | ||
trace(xml.toString()); | ||
} | ||
|
||
function dump(node: XML) { | ||
trace("// " + node.localName() + " namespace()"); | ||
traceNs(node.namespace()); | ||
trace(""); | ||
|
||
trace("// " + node.localName() + " inScopeNamespaces()"); | ||
for each (var ns in node.inScopeNamespaces()) { | ||
traceNs(ns); | ||
} | ||
trace(""); | ||
|
||
trace("// " + node.localName() + " inScopeNamespaces()"); | ||
for each (var ns in node.inScopeNamespaces()) { | ||
traceNs(ns); | ||
} | ||
trace(""); | ||
|
||
trace("// " + node.localName() + " namespaceDeclarations()"); | ||
for each (var ns in node.namespaceDeclarations()) { | ||
traceNs(ns); | ||
} | ||
trace(""); | ||
|
||
trace("// " + node.localName() + " namespace(\"middlens\")"); | ||
trace(node.namespace("middlens")); | ||
trace(""); | ||
|
||
for each (var child in node.children()) { | ||
dump(child); | ||
} | ||
} | ||
|
||
function traceNs(ns: Namespace) { | ||
trace(ns.prefix + " = " + ns.uri); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
// root namespace() | ||
= | ||
|
||
// root inScopeNamespaces() | ||
= | ||
|
||
// root inScopeNamespaces() | ||
= | ||
|
||
// root namespaceDeclarations() | ||
|
||
// root namespace("middlens") | ||
undefined | ||
|
||
// outer namespace() | ||
= | ||
|
||
// outer inScopeNamespaces() | ||
= | ||
|
||
// outer inScopeNamespaces() | ||
= | ||
|
||
// outer namespaceDeclarations() | ||
|
||
// outer namespace("middlens") | ||
undefined | ||
|
||
// top namespace() | ||
= | ||
|
||
// top inScopeNamespaces() | ||
topns = https://example.org/top | ||
|
||
// top inScopeNamespaces() | ||
topns = https://example.org/top | ||
|
||
// top namespaceDeclarations() | ||
topns = https://example.org/top | ||
|
||
// top namespace("middlens") | ||
undefined | ||
|
||
// middle namespace() | ||
= | ||
|
||
// middle inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// middle inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// middle namespaceDeclarations() | ||
middlens = https://example.org/middle | ||
|
||
// middle namespace("middlens") | ||
https://example.org/middle | ||
|
||
// bottom namespace() | ||
= | ||
|
||
// bottom inScopeNamespaces() | ||
bottomns = https://example.org/bottom | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// bottom inScopeNamespaces() | ||
bottomns = https://example.org/bottom | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// bottom namespaceDeclarations() | ||
bottomns = https://example.org/bottom | ||
|
||
// bottom namespace("middlens") | ||
https://example.org/middle | ||
|
||
// namespacedTopnsSibling namespace() | ||
topns = https://example.org/top | ||
|
||
// namespacedTopnsSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// namespacedTopnsSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// namespacedTopnsSibling namespaceDeclarations() | ||
|
||
// namespacedTopnsSibling namespace("middlens") | ||
https://example.org/middle | ||
|
||
// namespacedMiddlensSibling namespace() | ||
middlens = https://example.org/middle | ||
|
||
// namespacedMiddlensSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// namespacedMiddlensSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top | ||
|
||
// namespacedMiddlensSibling namespaceDeclarations() | ||
|
||
// namespacedMiddlensSibling namespace("middlens") | ||
https://example.org/middle | ||
|
||
|
||
top.addNamespace(new Namespace("topns", "https://example.org/top/but/replaced")) | ||
top.addNamespace(new Namespace("middlens", "https://example.org/middle/but/replaced")) | ||
top.addNamespace(new Namespace("newns", "https://example.org/new")) | ||
top.addNamespace(new Namespace(undefined, "https://example.org/undefined")) | ||
|
||
// root namespace() | ||
= | ||
|
||
// root inScopeNamespaces() | ||
= | ||
|
||
// root inScopeNamespaces() | ||
= | ||
|
||
// root namespaceDeclarations() | ||
|
||
// root namespace("middlens") | ||
undefined | ||
|
||
// outer namespace() | ||
= | ||
|
||
// outer inScopeNamespaces() | ||
= | ||
|
||
// outer inScopeNamespaces() | ||
= | ||
|
||
// outer namespaceDeclarations() | ||
|
||
// outer namespace("middlens") | ||
undefined | ||
|
||
// top namespace() | ||
= | ||
|
||
// top inScopeNamespaces() | ||
topns = https://example.org/top/but/replaced | ||
middlens = https://example.org/middle/but/replaced | ||
newns = https://example.org/new | ||
|
||
// top inScopeNamespaces() | ||
topns = https://example.org/top/but/replaced | ||
middlens = https://example.org/middle/but/replaced | ||
newns = https://example.org/new | ||
|
||
// top namespaceDeclarations() | ||
topns = https://example.org/top/but/replaced | ||
middlens = https://example.org/middle/but/replaced | ||
newns = https://example.org/new | ||
|
||
// top namespace("middlens") | ||
https://example.org/middle/but/replaced | ||
|
||
// middle namespace() | ||
= | ||
|
||
// middle inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// middle inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// middle namespaceDeclarations() | ||
middlens = https://example.org/middle | ||
|
||
// middle namespace("middlens") | ||
https://example.org/middle | ||
|
||
// bottom namespace() | ||
= | ||
|
||
// bottom inScopeNamespaces() | ||
bottomns = https://example.org/bottom | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// bottom inScopeNamespaces() | ||
bottomns = https://example.org/bottom | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// bottom namespaceDeclarations() | ||
bottomns = https://example.org/bottom | ||
|
||
// bottom namespace("middlens") | ||
https://example.org/middle | ||
|
||
// namespacedTopnsSibling namespace() | ||
undefined = https://example.org/top | ||
|
||
// namespacedTopnsSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// namespacedTopnsSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// namespacedTopnsSibling namespaceDeclarations() | ||
|
||
// namespacedTopnsSibling namespace("middlens") | ||
https://example.org/middle | ||
|
||
// namespacedMiddlensSibling namespace() | ||
middlens = https://example.org/middle | ||
|
||
// namespacedMiddlensSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// namespacedMiddlensSibling inScopeNamespaces() | ||
middlens = https://example.org/middle | ||
topns = https://example.org/top/but/replaced | ||
newns = https://example.org/new | ||
|
||
// namespacedMiddlensSibling namespaceDeclarations() | ||
|
||
// namespacedMiddlensSibling namespace("middlens") | ||
https://example.org/middle | ||
|
||
|
||
|
||
<root><outer><top test="top with topns" xmlns:topns="https://example.org/top/but/replaced" xmlns:middlens="https://example.org/middle/but/replaced" xmlns:newns="https://example.org/new" xmlns="https://example.org/top"><middle test="middle with topns" xmlns:middlens="https://example.org/middle"><bottom test="bottom with topns" bottomns:test="bottom with bottomns" xmlns:bottomns="https://example.org/bottom"/><namespacedTopnsSibling/><middlens:namespacedMiddlensSibling/></middle></top></outer></root> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_frames = 1 |