Пример #1
0
        private XMLDocument ParseText(string text, XMLListener l)
        {
            int count = 0;

            for (XMLTokenizer tokenizer = new XMLTokenizer(text); tokenizer
                 .HasMoreElements();)
            {
                string str = tokenizer.NextElement();
                if ((str.StartsWith("<?")) && (str.EndsWith("?>")))
                {
                    NewProcessing(str, l, count);
                }
                else if ((str.StartsWith("<!--")) && (str.EndsWith("-->")))
                {
                    NewComment(str, l, count);
                }
                else if (str[0] == '<')
                {
                    NewElement(str, l, count);
                }
                else
                {
                    NewData(str, l, count);
                }
                count++;
            }


            return(new XMLDocument(this.header.ToString(), this.rootElement));
        }
Пример #2
0
        private XMLDocument ParseText(string text, XMLListener l)
        {
            int count = 0;
                for (XMLTokenizer tokenizer = new XMLTokenizer(text); tokenizer
                        .HasMoreElements(); )
                {
                    string str = tokenizer.NextElement();
                    if ((str.StartsWith("<?")) && (str.EndsWith("?>")))
                    {
                        NewProcessing(str, l, count);
                    }
                    else if ((str.StartsWith("<!--")) && (str.EndsWith("-->")))
                    {
                        NewComment(str, l, count);
                    }
                    else if (str[0] == '<')
                    {

                            NewElement(str, l, count);

                    }
                    else
                    {
                        NewData(str, l, count);
                    }
                    count++;
                }

            return new XMLDocument(this.header.ToString(), this.rootElement);
        }