Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6D4B18472 for ; Sun, 10 Apr 2016 22:48:13 +0000 (UTC) Received: (qmail 65296 invoked by uid 500); 10 Apr 2016 22:48:13 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 65206 invoked by uid 500); 10 Apr 2016 22:48:13 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 65044 invoked by uid 99); 10 Apr 2016 22:48:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Apr 2016 22:48:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BC97AEAB43; Sun, 10 Apr 2016 22:48:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: harbs@apache.org To: commits@flex.apache.org Date: Sun, 10 Apr 2016 22:48:22 -0000 Message-Id: In-Reply-To: <4558968a9021473885306475a5ca9ca7@git.apache.org> References: <4558968a9021473885306475a5ca9ca7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/49] git commit: [flex-asjs] [refs/heads/develop] - Hopefully made some sense out of namespaces Hopefully made some sense out of namespaces Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f6aee89e Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f6aee89e Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f6aee89e Branch: refs/heads/develop Commit: f6aee89e0aa0fabd1a8ca4a2ec91933849494782 Parents: eb91e10 Author: Harbs Authored: Sun Feb 7 13:28:26 2016 +0200 Committer: Harbs Committed: Sun Feb 7 13:28:26 2016 +0200 ---------------------------------------------------------------------- frameworks/projects/XML/as/src/QName.as | 31 ++++++++ frameworks/projects/XML/as/src/XML.as | 111 +++++++++++++++++++++++++-- 2 files changed, 137 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6aee89e/frameworks/projects/XML/as/src/QName.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/XML/as/src/QName.as b/frameworks/projects/XML/as/src/QName.as index 2ceb487..5232bbe 100644 --- a/frameworks/projects/XML/as/src/QName.as +++ b/frameworks/projects/XML/as/src/QName.as @@ -125,6 +125,37 @@ package _isAttribute = value; } + public function getNamespace(namespaces:Array=null):Namespace + { + /* + When the [[GetNamespace]] method of a QName q is called with no arguments or one argument InScopeNamespaces, the following steps are taken: + 1. If q.uri is null, throw a TypeError exception NOTE the exception above should never occur due to the way [[GetNamespace]] is called in this specification + 2. If InScopeNamespaces was not specified, let InScopeNamespaces = { } + 3. Find a Namespace ns in InScopeNamespaces, such that ns.uri == q.uri. If more than one such Namespace ns exists, the implementation may choose one of the matching Namespaces arbitrarily. NOTE implementations that preserve prefixes in qualified names may additionally constrain ns, such that ns.prefix == q.[[Prefix]] + 4. If no such namespace ns exists + a. Let ns be a new namespace created as if by calling the constructor new Namespace(q.uri) NOTE implementations that preserve prefixes and qualified names may create the new namespaces as if by calling the constructor Namespace(q.[[Prefix]], q.uri) + 5. Return ns + */ + var i:int; + var possibleMatch:Namespace; + if(!namespaces) + namespaces = []; + for(i=0;i