You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Markus Wiederkehr <ma...@gmail.com> on 2005/06/30 11:33:26 UTC

[OT] Tool to simplify HTML

Sorry if this question is a bit off topic, but I thought people on
this mailing list might know...

I'm working on a Tapestry application that has to display arbitrary
HTML files inline (like GMail does when you receive an HTML e-mail,
for example). So basically I want to develop a Tapestry component that
can render an HTML file.

The obvious requirement is that I don't want my page to be corrupted
by the HTML file. So I would have to remove /bad/ elements like
SCRIPT, /bad/ attributes like ID or NAME, etc. But in addition the
result also has to be compliant to XHTML 1.0 Transitional, no matter
how sloppy the original HTML file is.

I tried to run the HTML through NekoHTML to create a DOM. Then I tried
to remove bad elements and attributes from that DOM, but still the
result might not be XHTML compliant due to missing or misplaced
elements. So that approach looks like a lot of work...

Has anyone done something like this or has anyone a better idea how to
accomplish this?

Thanks,

Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: [OT] Tool to simplify HTML

Posted by Dmitriy Rashko <dr...@sourcevalley.com>.
You can try jTidy it has xHtml formatter

Markus Wiederkehr wrote:

>Sorry if this question is a bit off topic, but I thought people on
>this mailing list might know...
>
>I'm working on a Tapestry application that has to display arbitrary
>HTML files inline (like GMail does when you receive an HTML e-mail,
>for example). So basically I want to develop a Tapestry component that
>can render an HTML file.
>
>The obvious requirement is that I don't want my page to be corrupted
>by the HTML file. So I would have to remove /bad/ elements like
>SCRIPT, /bad/ attributes like ID or NAME, etc. But in addition the
>result also has to be compliant to XHTML 1.0 Transitional, no matter
>how sloppy the original HTML file is.
>
>I tried to run the HTML through NekoHTML to create a DOM. Then I tried
>to remove bad elements and attributes from that DOM, but still the
>result might not be XHTML compliant due to missing or misplaced
>elements. So that approach looks like a lot of work...
>
>Has anyone done something like this or has anyone a better idea how to
>accomplish this?
>
>Thanks,
>
>Markus
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: [OT] Tool to simplify HTML

Posted by Fernando Padilla <fe...@alum.mit.edu>.
Look at iframe:
http://www.w3.org/TR/REC-html40/present/frames.html#h-16.5
http://www.htmlcodetutorial.com/frames/_IFRAME.html

<iframe id="myframe" src="url" width="width" height="height"/>



But then the HTML fragment has to be a different URL.  Or you can try
using some sort of javascript to squirt the HTML into the iframe:

http://www.codingforums.com/archive/index.php/t-22953.html

document.frames['myframe'].document.write( "<html></html>" );





Markus Wiederkehr wrote:
> Sorry if this question is a bit off topic, but I thought people on
> this mailing list might know...
> 
> I'm working on a Tapestry application that has to display arbitrary
> HTML files inline (like GMail does when you receive an HTML e-mail,
> for example). So basically I want to develop a Tapestry component that
> can render an HTML file.
> 
> The obvious requirement is that I don't want my page to be corrupted
> by the HTML file. So I would have to remove /bad/ elements like
> SCRIPT, /bad/ attributes like ID or NAME, etc. But in addition the
> result also has to be compliant to XHTML 1.0 Transitional, no matter
> how sloppy the original HTML file is.
> 
> I tried to run the HTML through NekoHTML to create a DOM. Then I tried
> to remove bad elements and attributes from that DOM, but still the
> result might not be XHTML compliant due to missing or misplaced
> elements. So that approach looks like a lot of work...
> 
> Has anyone done something like this or has anyone a better idea how to
> accomplish this?
> 
> Thanks,
> 
> Markus
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: [OT] Tool to simplify HTML

Posted by Jonathan O'Connor <Jo...@xcom.de>.
Markus,
Can you use a frame instead? Then anything that happens in the frame won't
affect anything in the other parts of the page.
Ciao,
Jonathan O'Connor
XCOM Dublin


                                                                           
             Markus Wiederkehr                                             
             <markus.wiederkeh                                             
             r@gmail.com>                                               To 
                                       Tapestry users                      
             30/06/2005 10:33          <ta...@jakarta.apache.org>  
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             "Tapestry users"          [OT] Tool to simplify HTML          
             <tapestry-user@ja                                             
             karta.apache.org>                                             
                                                                           
                                                                           
                                                                           
                                                                           




Sorry if this question is a bit off topic, but I thought people on
this mailing list might know...

I'm working on a Tapestry application that has to display arbitrary
HTML files inline (like GMail does when you receive an HTML e-mail,
for example). So basically I want to develop a Tapestry component that
can render an HTML file.

The obvious requirement is that I don't want my page to be corrupted
by the HTML file. So I would have to remove /bad/ elements like
SCRIPT, /bad/ attributes like ID or NAME, etc. But in addition the
result also has to be compliant to XHTML 1.0 Transitional, no matter
how sloppy the original HTML file is.

I tried to run the HTML through NekoHTML to create a DOM. Then I tried
to remove bad elements and attributes from that DOM, but still the
result might not be XHTML compliant due to missing or misplaced
elements. So that approach looks like a lot of work...

Has anyone done something like this or has anyone a better idea how to
accomplish this?

Thanks,

Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist allein
für den Gebrauch durch den vorgesehenen Empfaenger bestimmt. Dritten ist
das Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten,
eine fehlgeleitete E-Mail unverzueglich vollstaendig zu loeschen und uns
eine Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole use
of the intended recipient. Any review, distribution by others or forwarding
without express permission is strictly prohibited. If you are not the
intended recipient, please contact the sender and delete all copies.