Example #1
0
        public void OnStartElement(string name, SmallXmlParser.IAttrList attrs)
        {
            SecurityElement newel = new SecurityElement(name);

            if (root == null)
            {
                root    = newel;
                current = newel;
            }
            else
            {
                SecurityElement parent = (SecurityElement)stack.Peek();
                parent.AddChild(newel);
            }
            stack.Push(newel);
            current = newel;
            // attributes
            int n = attrs.Length;

            for (int i = 0; i < n; i++)
            {
                string tmpStr = attrs.GetValue(i);
                if (attrs.GetName(i) == "Consume_Info")
                {
                    tmpStr = tmpStr.Replace('"', '\'');
                }
                current.AddAttribute(attrs.GetName(i), tmpStr);
            }
        }
Example #2
0
        public void OnStartElement(string name, SmallXmlParser.IAttrList attrs)
        {
            SecurityElement newel = new SecurityElement(name);

            if (root == null)
            {
                root    = newel;
                current = newel;
            }
            else
            {
                SecurityElement parent = (SecurityElement)stack.Peek();
                parent.AddChild(newel);
            }
            stack.Push(newel);
            current = newel;
            // attributes
            int n = attrs.Length;

            for (int i = 0; i < n; i++)
            {
                string attrName  = SecurityElement.Escape(attrs.GetName(i));
                string attrValue = SecurityElement.Escape(attrs.GetValue(i));
                current.AddAttribute(attrName, attrValue);
            }
        }
Example #3
0
        public void OnStartElement(string name, SmallXmlParser.IAttrList attrs)
        {
            SecurityElement securityElement = new SecurityElement(name);

            if (this.root == null)
            {
                this.root    = securityElement;
                this.current = securityElement;
            }
            else
            {
                SecurityElement securityElement2 = (SecurityElement)this.stack.Peek();
                securityElement2.AddChild(securityElement);
            }
            this.stack.Push(securityElement);
            this.current = securityElement;
            int length = attrs.Length;

            for (int i = 0; i < length; i++)
            {
                string text  = SecurityElement.Escape(attrs.GetName(i));
                string text2 = SecurityElement.Escape(attrs.GetValue(i));
                this.current.AddAttribute(text, text2);
            }
        }
        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);
            }
        }
Example #5
0
        public void OnStartElement(string name, SmallXmlParser.IAttrList attrs)
        {
            SecurityElement child = new SecurityElement(name);

            if (this.root == null)
            {
                this.root    = child;
                this.current = child;
            }
            else
            {
                ((SecurityElement)this.stack.Peek()).AddChild(child);
            }
            this.stack.Push(child);
            this.current = child;
            int length = attrs.Length;

            for (int i = 0; i < length; i++)
            {
                this.current.AddAttribute(attrs.GetName(i), attrs.GetValue(i));
            }
        }