Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to process HTML pages on server side with HTML DOM?

Reply
Thread Tools

How to process HTML pages on server side with HTML DOM?

 
 
Vince C.
Guest
Posts: n/a
 
      01-05-2004
Hi.

I'd like to process HTML documents in an ASP script, i.e. to remove any unwanted
elements and extract desired element and attributes. I know how to do it on
client side within IE using its HTML DOM. But what I'd like is to do it
server-side. Is there a way, for instance, to reuse MSIE technology to retrieve
interfaces like IHTMLElement, IHTMLDOMAttribute, aso, or just built-in features
that would allow me to do the same?

Thanks or any hint/suggestion.

Vince C.


 
Reply With Quote
 
 
 
 
Yan-Hong Huang[MSFT]
Guest
Posts: n/a
 
      01-05-2004
Hi Vince,

Thanks for posting in the group.

Currently I am finding somebody who could help you on it. We will get back
here with more information as soon as possible. If you have any more
concerns, please feel free to post here.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
MSFT
Guest
Posts: n/a
 
      01-06-2004
Hi Vince,

As I understabd, you want to parse the DOM element for a HTML file in ASP
server script. To achieve this, we may read the HTML file with FSO and Load
it in a HTMLDocument object, for example:

<%@Language=VBScript CODEPAGE=65001 %>

<%

Dim doc

Set doc = CreateObject("HTMLFILE")

dim objFSO

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

dim htmlFile

set htmlFile= objFSO.OpenTextFile("c:\test.html")


doc.write htmlFile.ReadAll

'doc.body.innerText="hello world"

Response.Write doc.documentElement.outerHTML

%>

Hope this answer your question,

Regards,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
Vince C.
Guest
Posts: n/a
 
      01-06-2004
"MSFT" <> a écrit dans le message de
news...
> Hi Vince,
>
> As I understabd, you want to parse the DOM element for a HTML file in ASP
> server script. To achieve this, we may read the HTML file with FSO and Load
> it in a HTMLDocument object, for example:
>
> <%@Language=VBScript CODEPAGE=65001 %>
>
> <%
>
> Dim doc
>
> Set doc = CreateObject("HTMLFILE")
>
> dim objFSO
>
> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
>
> dim htmlFile
>
> set htmlFile= objFSO.OpenTextFile("c:\test.html")
>
>
> doc.write htmlFile.ReadAll
>
> 'doc.body.innerText="hello world"
>
> Response.Write doc.documentElement.outerHTML
>
> %>
>
> Hope this answer your question,


Oh my! I never thought it was so simple! Knocks one's socks off... It was worth
asking the question before reinventing the wheel.

Not even threading nor performance issues apart from those that relate to using
FSO? Note you don't need to say "yes" as I'm already satisfied .

Vince C.
"- Use the forge, Luke..."


 
Reply With Quote
 
MSFT
Guest
Posts: n/a
 
      01-07-2004
Hi Vince,

For frequently requested web page, we need to consider the performance for
FSO. Anyway, FSO is the common way we use in ASP to read a file.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
Pete
Guest
Posts: n/a
 
      01-07-2004
Or, if your html is xml-compliant, you can always use the XML Parser.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Vince C.
Guest
Posts: n/a
 
      01-07-2004
"Pete" <> a écrit dans le message de
news:%...
> Or, if your html is xml-compliant, you can always use the XML Parser.


That's my problem: it's not. Because modified (for now) by non XHTML-aware
Office tools.

Vince C.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
URGENT: Process html pages as aspx pages. jainamber@gmail.com ASP .Net 1 10-31-2006 09:27 PM
How-to? - Process Client-side AND Server-side Code Blocks With aspnet Button Joey ASP .Net 1 01-03-2006 11:01 PM
Server-Side Control - Embedded Server-Side Code - Inline Mythran ASP .Net 2 01-22-2005 01:02 AM
data synchronisation - java server side or www server side? Thor Java 1 07-02-2003 05:44 PM



Advertisments