예제 #1
0
 public void AddFrom(NamespaceManager nsmgr)
 {
     foreach (string uri in nsmgr.GetNamespaces())
     {
         AddNamespace(uri, nsmgr.GetPrefix(uri));
     }
 }
예제 #2
0
        public virtual string GetPrefix(string uri)
        {
            string ret = (string)atob[uri];

            if (ret != null)
            {
                return(ret);
            }
            if (parent != null)
            {
                return(parent.GetPrefix(uri));
            }
            return(null);
        }
예제 #3
0
		public void AddFrom(NamespaceManager nsmgr) {
			foreach (string uri in nsmgr.GetNamespaces())
				AddNamespace(uri, nsmgr.GetPrefix(uri));
		}
예제 #4
0
        private void Start()
        {
            if (initialized)
            {
                return;
            }
            initialized = true;

            if (doc == null)
            {
                doc = new XmlDocument();
            }

            doc.AppendChild(doc.CreateXmlDeclaration("1.0", null, null));
            string rdfprefix = ns.GetPrefix(NS.RDF);

            if (rdfprefix == null)
            {
                if (ns.GetNamespace("rdf") == null)
                {
                    rdfprefix = "rdf";
                    ns.AddNamespace(NS.RDF, "rdf");
                }
            }

            XmlElement root = doc.CreateElement(rdfprefix + ":RDF", NS.RDF);

            foreach (string prefix in ns.GetPrefixes())
            {
                root.SetAttribute("xmlns:" + prefix, ns.GetNamespace(prefix));
            }

            if (BaseUri != null)
            {
                root.SetAttribute("xml:base", BaseUri);
            }

            doc.AppendChild(root);
        }
예제 #5
0
 /// <summary>
 /// Gets the prefix of the specified namespace.
 /// </summary>
 /// <param name="uri">The URI.</param>
 /// <returns></returns>
 public override string GetPrefix(string uri)
 {
     return(m_OriginalNamespaceManager.GetPrefix(uri));
 }