Ejemplo 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);
            }
        }
Ejemplo n.º 2
0
 public XMLSection loadXML(string xml)
 {
     root = null;
     Parse(new StringReader(xml), this);
     return(root);
 }
Ejemplo n.º 3
0
 public void OnEndElement(string name)
 {
     current = (XMLSection)stack.Pop();
 }