public void AddFrom(NamespaceManager nsmgr) { foreach (string uri in nsmgr.GetNamespaces()) { AddNamespace(uri, nsmgr.GetPrefix(uri)); } }
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); }
public void AddFrom(NamespaceManager nsmgr) { foreach (string uri in nsmgr.GetNamespaces()) AddNamespace(uri, nsmgr.GetPrefix(uri)); }
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); }
/// <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)); }