예제 #1
0
        protected NsInfo GetContextNsInfo()
        {
            if (AliasContext.Peek() == null)
            {
                return(NamespaceResolver.GetNsInfo(_currentDocument));
            }

            return(NamespaceResolver.GetNsInfo(AliasContext.Peek().AliasDefinition));
        }
예제 #2
0
        private void WritePendingNamespaceDeclarations(string uri)
        {
            NsInfo nsInfo = NamespaceResolver.GetNsInfo(_currentDocument);

            if (nsInfo == null)
            {
                return;
            }

            foreach (var ns in nsInfo.Namespaces)
            {
                if (ns.Value == uri)
                {
                    continue;
                }
                _xmlTextWriter.WriteAttributeString("xmlns", ns.Name, null, ns.Value);
            }
        }