[Shellweb-main] =?GB2312?B?UmU6IFtTaGVsbHdlYi1tYWluXSBSZTogW1NoZWxsd2ViLW1haW5dIA==?= =?GB2312?B?Um
Status: Alpha
Brought to you by:
alexe_cn
|
From: Anthony WU <ant...@gm...> - 2006-01-09 13:06:50
|
有像在 HTML::TreeBuilder 的回
GUI感冒...汗....
只能思路.....
例如...
$p = bless {
'content' => [
bless {
'color' => 'blue',
'content' => [
bless {
'innerTXT' => 'text'
}, 'shellweb::parser::html::b'
]
}, 'shellweb::parser::html::font',
bless {
'color' => 'red',
'innerTXT' => 'only'
}, 'shellweb::parser::html::font'
]
}, 'shellweb::parser::html::a'
$p->start (); #指向 a->new () 在性 <a>
$p->style (); #定 attributes
$p->assembly ();#loop + 指向子 object
$x = $p->[n]->start (); #指向 font->new () 在性 <font>
$x = $p->[n]->style (); #定 attributes
$x = $p->[n]->end (); #指向 $p->pack ($x);
$p->end (); #指向 mw->pack ()
像 Tk 或其他 GUI 的合方式吧....
像下面的端例子也可以很就可以解
<div>
<div>
<img src="xx.jpg"><span>hi,<font="Arial">just <font
color="red"><i><b><u>f</u>o</b>r <a
href="xxx.com">test</a></i></font></font></span>
</div>
</div>
而且也有利於以後加入 CSS 或 JS 支援
ale...@gm... 提到:
>Anthony WU,你能给个如何再解析这些的代码实例吗?
>
>
>2006/1/9, Anthony WU <ant...@gm...>:
>
>
>>我的想法是
>><a href="aaa.htm"><font
>>color="blue"><b>test</b></font><font
>>color="red">only</font></a>
>>解成
>>bless {
>> bless {
>> 'href' => ' aaa.htm',
>> bless {
>> bless {
>> 'color' => 'blue',
>> bless {
>> 'innerTXT' => 'text'
>> }, 'shellweb::parser::html::b'
>> }, 'shellweb::parser::html::font',
>> bless {
>> 'color' => 'red',
>> 'innerTXT' => 'only'
>> }, 'shellweb::parser::html::font'
>> }, 'shellweb::parser::html::a'
>> }, 'shellweb::parser::html'
>>}
>>
>>2006/1/9, ale...@gm... <ale...@gm...>:
>>
>>
>>
>>
>
>
>--
>+--------------------------------------------+
> |By Alexe (http://www.alexe.cn)|
>+--------------------------------------------+
>NY薜'
>蕈㈣!kC 濉蘩@^^j!2㈥澧辨,悍a{,H蛟4i(辟堍o'锃Yhr'庄:rX===
>
--
Best Regards,
Anthony WU
|