Exemplo n.º 1
0
        private void AddChildNodes(ufDateNode xNode, ufDateNode node, uFElementDescriber ufElement)
        {
            if (ufElement.AttributeValues.Count > 0)
            {
                // If its a rel or rev uf based on attribute values, just copy it
                //ufDateNode xNodeChild = xNode.Nodes.Append(node.Name, node.Value);
                foreach (ufDateNode childNode in node.Nodes)
                {
                    xNode.Nodes.Add(childNode.Name, childNode.Value, childNode.SourceUrl, childNode.RepresentativeNode);
                }
            }

            foreach (uFElementDescriber childElement in ufElement.Elements)
            {
                // Loop orginal data tree
                foreach (ufDateNode childNode in node.Nodes)
                {
                    // If node name = element describer name
                    if (childNode.Name == childElement.Name)
                    {
                        // If element can have multiples call the AppendArrayList method
                        if (childElement.Multiples)
                        {
                            ufDateNode xChild = xNode.Nodes.Append(childNode.Name, childNode.Value, childNode.SourceUrl, childNode.RepresentativeNode);
                            AddChildNodes(xChild, childNode, childElement);
                        }
                        else
                        {
                            int        index  = xNode.Nodes.Add(childNode.Name, childNode.Value, childNode.SourceUrl, childNode.RepresentativeNode);
                            ufDateNode xChild = xNode.Nodes[index];
                            AddChildNodes(xChild, childNode, childElement);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void AddChildNodes(ufDateNode xNode, ufDateNode node, uFElementDescriber ufElement)
        {
            if (ufElement.AttributeValues.Count > 0)
            {
                // If its a rel or rev uf based on attribute values, just copy it
                //ufDateNode xNodeChild = xNode.Nodes.Append(node.Name, node.Value);
                foreach (ufDateNode childNode in node.Nodes)
                    xNode.Nodes.Add(childNode.Name, childNode.Value, childNode.SourceUrl, childNode.RepresentativeNode);

            }

            foreach (uFElementDescriber childElement in ufElement.Elements)
            {
                // Loop orginal data tree
                foreach (ufDateNode childNode in node.Nodes)
                {
                    // If node name = element describer name
                    if (childNode.Name == childElement.Name)
                    {
                        // If element can have multiples call the AppendArrayList method
                        if (childElement.Multiples)
                        {
                            ufDateNode xChild = xNode.Nodes.Append(childNode.Name, childNode.Value, childNode.SourceUrl, childNode.RepresentativeNode);
                            AddChildNodes(xChild, childNode, childElement);
                        }
                        else
                        {
                            int index = xNode.Nodes.Add(childNode.Name, childNode.Value, childNode.SourceUrl, childNode.RepresentativeNode);
                            ufDateNode xChild = xNode.Nodes[index];
                            AddChildNodes(xChild, childNode, childElement);
                        }
                    }
                }
            }
        }