// Token: 0x06006EB0 RID: 28336 RVA: 0x001FCA0C File Offset: 0x001FAC0C
        private static IList <BamlTreeNode> SplitXmlContent(BamlLocalizableResourceKey key, string content, BamlTreeUpdater.BamlTreeUpdateMap bamlTreeMap)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("<ROOT>");
            stringBuilder.Append(content);
            stringBuilder.Append("</ROOT>");
            IList <BamlTreeNode> list        = new List <BamlTreeNode>(4);
            XmlDocument          xmlDocument = new XmlDocument();
            bool flag = true;

            try
            {
                xmlDocument.LoadXml(stringBuilder.ToString());
                XmlElement xmlElement = xmlDocument.FirstChild as XmlElement;
                if (xmlElement != null && xmlElement.HasChildNodes)
                {
                    int num = 0;
                    while (num < xmlElement.ChildNodes.Count && flag)
                    {
                        flag = BamlTreeUpdater.GetBamlTreeNodeFromXmlNode(key, xmlElement.ChildNodes[num], bamlTreeMap, list);
                        num++;
                    }
                }
            }
            catch (XmlException)
            {
                bamlTreeMap.Resolver.RaiseErrorNotifyEvent(new BamlLocalizerErrorNotifyEventArgs(key, BamlLocalizerError.SubstitutionAsPlaintext));
                flag = BamlTreeUpdater.GetBamlTreeNodeFromText(key, content, bamlTreeMap, list);
            }
            if (!flag)
            {
                return(null);
            }
            return(list);
        }
        // Token: 0x06006EB1 RID: 28337 RVA: 0x001FCAE4 File Offset: 0x001FACE4
        private static bool GetBamlTreeNodeFromXmlNode(BamlLocalizableResourceKey key, XmlNode node, BamlTreeUpdater.BamlTreeUpdateMap bamlTreeMap, IList <BamlTreeNode> newChildrenList)
        {
            if (node.NodeType == XmlNodeType.Text)
            {
                return(BamlTreeUpdater.GetBamlTreeNodeFromText(key, node.Value, bamlTreeMap, newChildrenList));
            }
            if (node.NodeType != XmlNodeType.Element)
            {
                return(true);
            }
            XmlElement xmlElement = node as XmlElement;
            string     text       = bamlTreeMap.Resolver.ResolveFormattingTagToClass(xmlElement.Name);
            bool       flag       = string.IsNullOrEmpty(text);
            string     text2      = null;

            if (!flag)
            {
                text2 = bamlTreeMap.Resolver.ResolveAssemblyFromClass(text);
                flag  = string.IsNullOrEmpty(text2);
            }
            if (flag)
            {
                bamlTreeMap.Resolver.RaiseErrorNotifyEvent(new BamlLocalizerErrorNotifyEventArgs(key, BamlLocalizerError.UnknownFormattingTag));
                return(false);
            }
            string text3 = null;

            if (xmlElement.HasAttributes)
            {
                text3 = xmlElement.GetAttribute("Uid");
                if (!string.IsNullOrEmpty(text3))
                {
                    text3 = BamlResourceContentUtil.UnescapeString(text3);
                }
            }
            BamlStartElementNode bamlStartElementNode = null;

            if (text3 != null)
            {
                bamlStartElementNode = bamlTreeMap.MapUidToBamlTreeElementNode(text3);
            }
            if (bamlStartElementNode == null)
            {
                bamlStartElementNode = new BamlStartElementNode(text2, text, false, false);
                if (text3 != null)
                {
                    bamlTreeMap.AddBamlTreeNode(text3, new BamlLocalizableResourceKey(text3, text, "$Content", text2), bamlStartElementNode);
                    bamlStartElementNode.AddChild(new BamlDefAttributeNode("Uid", text3));
                }
                BamlTreeUpdater.TryAddContentPropertyToNewElement(bamlTreeMap, bamlStartElementNode);
                bamlStartElementNode.AddChild(new BamlEndElementNode());
            }
            else if (bamlStartElementNode.TypeFullName != text)
            {
                bamlTreeMap.Resolver.RaiseErrorNotifyEvent(new BamlLocalizerErrorNotifyEventArgs(key, BamlLocalizerError.DuplicateUid));
                return(false);
            }
            newChildrenList.Add(bamlStartElementNode);
            bool flag2 = true;

            if (xmlElement.HasChildNodes)
            {
                IList <BamlTreeNode> list = new List <BamlTreeNode>();
                int num = 0;
                while (num < xmlElement.ChildNodes.Count && flag2)
                {
                    flag2 = BamlTreeUpdater.GetBamlTreeNodeFromXmlNode(key, xmlElement.ChildNodes[num], bamlTreeMap, list);
                    num++;
                }
                if (flag2)
                {
                    BamlTreeUpdater.MergeChildrenList(key, bamlTreeMap, bamlStartElementNode, list);
                }
            }
            return(flag2);
        }