コード例 #1
0
        public void Reset()
        {
            this.name  = null;
            this.value = null;
            this.Type  = XML_ElementType.None;

            this.attr_dic.Clear();
            this.XMLobj_dic.Clear();
        }
コード例 #2
0
        private void Parse_ElementStart()
        {
            if (!this.ReadNext_char())
            {
                return;
            }

            if (this.currChar == '?')
            {
                this.sb.Clear();
                this.ParsingState = XML_ParseState.ElementName;
                this.ElementType  = XML_ElementType.Declare;
            }
            else if (this.currChar == '!')
            {
                this.sb.Clear();
                this.ParsingState = XML_ParseState.CommentValue;
                this.ElementType  = XML_ElementType.Comment;
            }
            else if (this.currChar == '>')
            {
                Hss_XML_obj xo = this.element_st.Peek();
                xo.Add_obj(new Hss_XML_obj(null, this.ElementType));

                this.ParsingState = XML_ParseState.OutElement;
            }
            else if (this.currChar == '/')
            {
                Hss_XML_obj xo = this.element_st.Pop();
                xo.value = HssStr.SafeXML_to_ori(this.sb.ToString().Trim());
                this.sb.Clear();

                this.element_st.Peek().Add_obj(xo);
                //xo.Show();//test output

                this.ParsingState = XML_ParseState.ElementEnd;
            }
            else
            {
                this.sb.Clear();
                this.sb.Append(this.currChar);

                this.ParsingState = XML_ParseState.ElementName;
                this.ElementType  = XML_ElementType.Normal;
            }
        }
コード例 #3
0
 public Hss_XML_obj(string name, XML_ElementType tp)
 {
     this.name = name;
     this.Type = tp;
 }