Exemplo n.º 1
0
 private IXsdNode getNodeWithName(IEnumerable <IXsdNode> nodes, string name)
 {
     foreach (IXsdNode xsdNode in nodes)
     {
         if (xsdNode is IXsdHasName)
         {
             IXsdHasName named = (IXsdHasName)xsdNode;
             if (named.Name == name)
             {
                 return(xsdNode);
             }
         }
     }
     return(null);
 }
Exemplo n.º 2
0
 private IXsdNode getNodeByName(string name)
 {
     //ATTENTION: Not namespace aware!
     if (string.IsNullOrEmpty(name))
     {
         return(null);
     }
     name = removeNamespace(name);
     foreach (IXsdNode node in GetAllNodes())
     {
         IXsdHasName element = node as IXsdHasName;
         if (element != null && element.Name != null)
         {
             string elementName = removeNamespace(element.Name);
             if (name.Equals(elementName))
             {
                 return((IXsdNode)element);
             }
         }
     }
     return(null);
 }