2009-07-26 3 views
3

私は、フォーマットされたテキストに翻訳する軽量のHTMLパーサーを探しています。軽量HTML書式付きテキストに翻訳するためのパーサー?

<html> 
<body> 
<a href="http://www.google.com/">Google</a> 
<img src="http://images.google.com/intl/en_us/images/logos/images_logo.gif" alt="Google image logo" /> 
<ol> 
<li>first</li> 
<li>second</li> 
</ol> 
<ul> 
<li>apple</li> 
<li>orange</li> 
</ul> 
<table><tr><td>cell a</td><td>&nbsp;</td><td>cell b</td></tr><tr><td>cell c</td><td>cell d</td><td>cell e</td></tr><table> 

</body> 
</html> 

へ:例えば

Google (link:http://www.google.com/) (img:Google images logo) 

1. first 
2. second 

- apple 
- orange 

cell a(tab) (tab)cell b 
cell c(tab)cell d(tab)cell e 

使用してXML/XSLTライブラリは、そのために行き過ぎです。

答えて

1

オープンソースのテキストブラウザ(foo.lynx)のソースを見ることができます。

0

私はこの問題のために最終的にhtmlcxxを選択しました。それは十分軽量です。

関連する問題