Exemple #1
0
 internal void Init(string prefix, string nsUri, string prevDefaultNsUri, NamespaceDecl next)
 {
     this.prefix           = prefix;
     this.nsUri            = nsUri;
     this.prevDefaultNsUri = prevDefaultNsUri;
     this.next             = next;
 }
Exemple #2
0
        internal void PopScope()
        {
            OutputScope elementScope = (OutputScope)this.elementScopesStack.Pop();

            Debug.Assert(elementScope != null); // We adding rootElementScope to garantee this

            for (NamespaceDecl scope = elementScope.Scopes; scope != null; scope = scope.Next)
            {
                Debug.WriteLine("Popping namespace scope : " + scope.Prefix + " : " + scope.Uri);
                this.defaultNS = scope.PrevDefaultNsUri;
            }
        }
        internal string ResolveNonAtom(string prefix)
        {
            Debug.Assert(prefix != null && prefix.Length > 0);

            for (NamespaceDecl scope = this.scopes; scope != null; scope = scope.Next)
            {
                if (Keywords.Compare(scope.Prefix, prefix))
                {
                    Debug.Assert(scope.Uri != null);
                    return(scope.Uri);
                }
            }
            return(null);
        }
        internal void PopScope()
        {
            Debug.Assert(this.scopeStack != null, "Push/Pop disbalance");
            if (this.scopeStack == null)
            {
                return;
            }

            for (NamespaceDecl scope = this.scopeStack.Scopes; scope != null; scope = scope.Next)
            {
                Debug.WriteLine("Popping namespace scope : " + scope.Prefix + " : " + scope.Uri);
                this.defaultNS = scope.PrevDefaultNsUri;
            }

            this.scopeStack = this.scopeStack.Parent;
        }
Exemple #5
0
        internal bool FindPrefix(string urn, out string prefix)
        {
            Debug.Assert(urn != null);

            for (NamespaceDecl scope = this.scopes; scope != null; scope = scope.Next)
            {
                if (Keywords.Equals(scope.Uri, urn) &&
                    scope.Prefix != null &&
                    scope.Prefix.Length > 0)
                {
                    prefix = scope.Prefix;
                    return(true);
                }
            }

            prefix = String.Empty;
            return(false);
        }
 internal NamespaceDecl AddNamespace(string prefix, string uri, string prevDefaultNsUri)
 {
     this.scopes = new NamespaceDecl(prefix, uri, prevDefaultNsUri, this.scopes);
     return(this.scopes);
 }
Exemple #7
0
 internal NamespaceDecl(string prefix, string nsUri, string prevDefaultNsUri, NamespaceDecl next)
 {
     Init(prefix, nsUri, prevDefaultNsUri, next);
 }
Exemple #8
0
 internal void Init(string prefix, string nsUri, string prevDefaultNsUri, NamespaceDecl next) {
     this.prefix           = prefix;
     this.nsUri            = nsUri;
     this.prevDefaultNsUri = prevDefaultNsUri;
     this.next             = next;
 }
Exemple #9
0
 internal NamespaceDecl(string prefix, string nsUri, string prevDefaultNsUri, NamespaceDecl next) {
     Init(prefix, nsUri, prevDefaultNsUri, next);
 }
Exemple #10
0
 internal NamespaceDecl AddNamespace(string prefix, string uri, string prevDefaultNsUri) {
     this.scopes = new NamespaceDecl(prefix, uri, prevDefaultNsUri, this.scopes);
     return this.scopes;
 }