Esempio n. 1
0
        public void OnStartElement(string name, SmallXmlParser.IAttrList attrs)
        {
            if (root == null)
            {
                root    = new XMLSection(name);
                current = root;
            }
            else
            {
                XMLSection parent = (XMLSection)stack.Peek();
                current = parent.createSection(name);
            }
            stack.Push(current);
            // attributes
            int n = attrs.Length;

            for (int i = 0; i < n; i++)
            {
                current.attrs[attrs.GetName(i)] = attrs.GetValue(i);
            }
        }
Esempio n. 2
0
 public XMLSection loadXML(string xml)
 {
     root = null;
     Parse(new StringReader(xml), this);
     return(root);
 }
Esempio n. 3
0
 public void OnEndElement(string name)
 {
     current = (XMLSection)stack.Pop();
 }