Beispiel #1
0
 private static void ResolveXmlNodesRecursively(XmlInheritance.XmlInheritanceNode node)
 {
     if (node.resolvedXmlNode != null)
     {
         Log.Error("XML error: Cyclic inheritance hierarchy detected for node \"" + node.xmlNode.Name + "\". Full node: " + node.xmlNode.OuterXml);
         return;
     }
     XmlInheritance.ResolveXmlNodeFor(node);
     for (int i = 0; i < node.children.Count; i++)
     {
         XmlInheritance.ResolveXmlNodesRecursively(node.children[i]);
     }
 }
Beispiel #2
0
        private static void ResolveXmlNodes()
        {
            List <XmlInheritance.XmlInheritanceNode> list = (from x in XmlInheritance.unresolvedNodes
                                                             where x.parent == null || x.parent.resolvedXmlNode != null
                                                             select x).ToList <XmlInheritance.XmlInheritanceNode>();

            for (int i = 0; i < list.Count; i++)
            {
                XmlInheritance.ResolveXmlNodesRecursively(list[i]);
            }
            for (int j = 0; j < XmlInheritance.unresolvedNodes.Count; j++)
            {
                if (XmlInheritance.unresolvedNodes[j].resolvedXmlNode == null)
                {
                    Log.Error("XML error: Cyclic inheritance hierarchy detected for node \"" + XmlInheritance.unresolvedNodes[j].xmlNode.Name + "\". Full node: " + XmlInheritance.unresolvedNodes[j].xmlNode.OuterXml);
                }
                else
                {
                    XmlInheritance.resolvedNodes.Add(XmlInheritance.unresolvedNodes[j].xmlNode, XmlInheritance.unresolvedNodes[j]);
                }
            }
            XmlInheritance.unresolvedNodes.Clear();
        }