コード例 #1
0
        //for test finding operation
        public static string[] Contents_of_givenLayout_Tags_TESTER(string html_content, string pattern, bool cut_sub_blocks)
        {
            Hashtable _tags_in_HTML = filtergivenHTMLtag_TESTER(html_content, pattern);

            string[] _content = null;

            int elementsize = 0;

            foreach (DictionaryEntry d in _tags_in_HTML)
            {
                string _tag = (string)d.Key;
                int    _cnt = (int)d.Value;

                _content = GrabbingofHTMLTags(html_content, _tag, _cnt);
                string temp = "";
                for (int i = 0; i < _content.Length; i++)
                {
                    string t_content = _content[i];
                    if (cut_sub_blocks)
                    {
                        t_content   = HTML.trimDIV(t_content);
                        t_content   = HTML.trimTD(t_content);
                        _content[i] = t_content;
                    }

                    temp = temp + t_content;
                }

                elementsize = elementsize + temp.Length;
            }

            return(_content);
        }
コード例 #2
0
ファイル: HTMLMarker.cs プロジェクト: erdincuzun/REA
        //for test finding operation
        public static string[] Contents_of_givenLayout_Tags_TESTER(string html_content, string pattern, bool cut_sub_blocks)
        {
            Hashtable _tags_in_HTML = filtergivenHTMLtag_TESTER(html_content, pattern);

            string[] _content    = null;
            string   s_tag       = pattern.Replace(".", " ");
            string   e_tag       = find_EndTag(s_tag);
            int      elementsize = 0;

            foreach (DictionaryEntry d in _tags_in_HTML)
            {
                string _tag = (string)d.Key;
                int    _cnt = (int)d.Value;

                _content = GrabbingofHTMLTags(html_content, _tag, _cnt);
                string temp = "";
                for (int i = 0; i < _content.Length; i++)
                {
                    string t_content = _content[i];
                    if (cut_sub_blocks)
                    {
                        t_content   = HTML.trimDIV(t_content);
                        t_content   = HTML.trimTD(t_content);
                        _content[i] = t_content;
                    }

                    temp = temp + t_content;

                    //başlagıç ve bitiş etiketi tekrar yazılıyor.
                    _content[i] = s_tag + _content[i] + e_tag;
                }

                elementsize = elementsize + temp.Length;
            }

            //başlangıç etiketini tekrar yapıştır.


            return(_content);
        }