Home All Groups Group Topic Archive Search About
Author
21 Feb 2006 9:51 PM
Nick
Hello,

I have a task to translate HTML text from a database to a legacy proprietary
format none html. For this I was hoping to load the HTML into object model
where each HTML table or div or span tag is an object from which I can read
the attributes and generate the proprietary output.
I tried using System.Web.UI.HTMLGenericControl for example:

Dim sHTML As New Web.UI.HtmlControls.HtmlGenericControl
sHTML.innerHTML= "some text<div>a div
tag</div><table><tr><td>C1</td></tr></table>"

Hoping that I can then access an HTMLTable control as a child control of
sHTML and the same for div/span tags. Is there a way to do this?
I used to be able to do the similar task with java script on the client
side. But I need to do that now without loading this html into a browser, I
need to do it on the server.

Thank you,
Nick

Author
24 Feb 2006 7:30 AM
Phillip Williams
Hello Nick,

You probably should think of solving the problem in a different way.  For
example, what are the pieces of information that you are looking to get out
of the HTML markup and then you might be able to use regular expressions to
convert the HTML objects to XML datatable.  In this example I did something
similar but with an XML input file:
http://www.webswapp.com/codesamples/aspnet20/regular_expressions/vb.aspx
Show quoteHide quote
"Nick" wrote:

> Hello,
>
> I have a task to translate HTML text from a database to a legacy proprietary
> format none html. For this I was hoping to load the HTML into object model
> where each HTML table or div or span tag is an object from which I can read
> the attributes and generate the proprietary output.
> I tried using System.Web.UI.HTMLGenericControl for example:
>
> Dim sHTML As New Web.UI.HtmlControls.HtmlGenericControl
> sHTML.innerHTML= "some text<div>a div
> tag</div><table><tr><td>C1</td></tr></table>"
>
> Hoping that I can then access an HTMLTable control as a child control of
> sHTML and the same for div/span tags. Is there a way to do this?
> I used to be able to do the similar task with java script on the client
> side. But I need to do that now without loading this html into a browser, I
> need to do it on the server.
>
> Thank you,
> Nick