Esempio n. 1
0
 internal NamespaceQualifiedValue(INamespaceManager NamespaceManager, string FullyQualifiedValue)
 {
     thisFullyQualifiedValue           = FullyQualifiedValue;
     thisFullyQualifiedValueComponents = thisFullyQualifiedValue.Split(':');
     if (thisFullyQualifiedValueComponents.Length == 1)
     {
         this.LocalName    = thisFullyQualifiedValueComponents[0];
         this.Namespace    = string.Empty;
         this.NamespaceUri = string.Empty;
     }
     else
     {
         this.LocalName    = thisFullyQualifiedValueComponents[1];
         this.Namespace    = thisFullyQualifiedValueComponents[0];
         this.NamespaceUri = NamespaceManager.LookupNamespace(this.Namespace);
     }
 }
Esempio n. 2
0
        private void InitializeNamespaceUri(INode QnameNode, INamespaceManager namespaceManager)
        {
            if (this.Namespace.Length == 0)
            {
                this.NamespaceUri = string.Empty;
                return;
            }
            string AttributeName = "xmlns:" + this.Namespace;
            var    currentNode   = QnameNode;

            while ((currentNode != null) && (string.IsNullOrEmpty(this.NamespaceUri) == true))
            {
                this.NamespaceUri = currentNode.GetAttributeValue(AttributeName);
                currentNode       = currentNode.ParentNode;
            }
            if (string.IsNullOrEmpty(this.NamespaceUri) == true)
            {
                this.NamespaceUri = namespaceManager.LookupNamespace(this.Namespace);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Gets the URI associated with a given namespace prefix.
 /// </summary>
 /// <param name="Prefix">
 /// The namespace prefix whose URI should be returned.
 /// </param>
 /// <returns>
 /// The namespace URI associated with the specified namespace prefix.
 /// </returns>
 public string GetUriForPrefix(string Prefix)
 {
     return(thisNamespaceManager.LookupNamespace(Prefix));
 }