[Qt-interest] Parsing a HTML document with non-supported html subsets

Castagne Nicolas nicolascastagne at yahoo.fr
Mon Jul 20 14:11:08 CEST 2009


Hello everyone,

To support Copy / paste from Excel / to QTable, I need to parse the text/html mime data writen by Excel in the Clipboard.

These data look like :
************************
 <table> 
....
  <tr height=13>

   <td class=xl24 align=right width=75 x:num="1.23456789012346E28">1,23E+28</td>

 </tr>
....

</table>

************************

Indeed, Excell sets a "x:num" attribute within the <td> tag, that encodes the full-precision floating point value.
This is, indeed, the value I need to paste.


Unfortunately, QTextDocument::setHtml will remove all these non-supported attributes, leading to :

************************
<td width="75">
<p align="right" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">1,23E+28</p>
</td>

************************

My question is :

How may parse properly, using Qt, the original HTML text ?
Is there any mean within qt to parse an html document without modifying it, or should I set up a parser of my own ?

Thanks much,
best-
Nicolas



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090720/2f5a1fcb/attachment.html 


More information about the Qt-interest-old mailing list