Esempio n. 1
0
 internal void Init(string prefix, string nsUri, string prevDefaultNsUri, NamespaceDecl?next)
 {
     _prefix           = prefix;
     _nsUri            = nsUri;
     _prevDefaultNsUri = prevDefaultNsUri;
     _next             = next;
 }
Esempio n. 2
0
        internal void PopScope()
        {
            OutputScope?elementScope = (OutputScope?)_elementScopesStack.Pop();

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

            for (NamespaceDecl?scope = elementScope.Scopes; scope != null; scope = scope.Next)
            {
                _defaultNS = scope.PrevDefaultNsUri;
            }
        }
Esempio n. 3
0
        internal string?ResolveNonAtom(string prefix)
        {
            Debug.Assert(prefix != null && prefix.Length > 0);

            for (NamespaceDecl?scope = this.scopes; scope != null; scope = scope.Next)
            {
                if (scope.Prefix == prefix)
                {
                    Debug.Assert(scope.Uri != null);
                    return(scope.Uri);
                }
            }
            return(null);
        }
Esempio n. 4
0
        internal void PopScope()
        {
            Debug.Assert(_scopeStack != null, "Push/Pop disbalance");
            if (_scopeStack == null)
            {
                return;
            }

            for (NamespaceDecl?scope = _scopeStack.Scopes; scope != null; scope = scope.Next)
            {
                _defaultNS = scope.PrevDefaultNsUri;
            }

            _scopeStack = _scopeStack.Parent;
        }
Esempio n. 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 (Ref.Equal(scope.Uri, urn) &&
                    scope.Prefix != null &&
                    scope.Prefix.Length > 0)
                {
                    prefix = scope.Prefix;
                    return(true);
                }
            }

            prefix = string.Empty;
            return(false);
        }
Esempio n. 6
0
 internal NamespaceDecl(string prefix, string nsUri, string prevDefaultNsUri, NamespaceDecl?next)
 {
     Init(prefix, nsUri, prevDefaultNsUri, next);
 }
Esempio n. 7
0
 internal NamespaceDecl AddNamespace(string prefix, string uri, string prevDefaultNsUri)
 {
     this.scopes = new NamespaceDecl(prefix, uri, prevDefaultNsUri, this.scopes);
     return(this.scopes);
 }