private void FillXmlTree(_XMLTree tree, string XML, int startChar, ref int lastChar) { tree.tagOpen = GetMainTag(XML); TagContent content = DefineTagContent(XML); string remains; if (content == TagContent.Content) { tree.tagContent = GetContent(XML, out remains); } else if (content == TagContent.Tree) { int idx = startChar; string NewXml = XML.Remove(0, tree.tagOpen.Length + 2); idx += tree.tagOpen.Length + 2; do { int lastIdx = 0; tree.subTrees.Add(new _XMLTree()); FillXmlTree(tree.subTrees[tree.subTrees.Count - 1], NewXml, idx, ref lastIdx); NewXml = NewXml.Remove(0, lastIdx - idx); idx += lastIdx; } while (!isClosingTagNext(tree.tagOpen, NewXml)); } }
public _XMLDeserialization(string XML) { XML_String = XML.Replace("\n", ""); int stringLength; do { stringLength = XML_String.Length; XML_String = XML_String.Replace(" <", "<"); XML_String = XML_String.Replace("> ", ">"); } while (stringLength != XML_String.Length); mainTree = new _XMLTree(); XML_String = XML_String.Trim(); }
public _XMLDeserialization() { mainTree = new _XMLTree(); }