有道通過Oracle XML DB功能,做這樣的事情:
select
value_test
from
XMLTable('$p'
passing XMLParse(content '<![CDATA[<DIV STYLE="text-align:LEFT;"><SPAN STYLE="letter-spacing:0px;color:#000000;font-size:10px;font-family:''Verdana'';">Value to be extract</SPAN></DIV>]]>')
as "p"
columns value_test varchar2(4000) path '/text()'
);
另一個變種這樣做:
select
dbms_xmlgen.convert(
XMLQuery('data($p)'
passing by value XMLParse(content '<![CDATA[<DIV STYLE="text-align:LEFT;"><SPAN STYLE="letter-spacing:0px;color:#000000;font-size:10px;font-family:''Verdana'';">Value to be extract</SPAN></DIV>]]>')
as "p"
returning content
).getCLOBVal(),
1
)
from dual;
它總是那種格式? – sgeddes 2013-03-22 03:15:20
樣式html將存儲在<![CDATA []]>中。根據定義的樣式 – 2013-03-22 03:26:48