Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/01/2009, 07:26
Avatar de Fernand0
Fernand0
 
Fecha de Ingreso: septiembre-2005
Ubicación: Buenos Aires
Mensajes: 610
Antigüedad: 18 años, 6 meses
Puntos: 19
Respuesta: Texto plano a HTML

A ver..

Código PHP:
$xml='<?xml version="1.0" encoding="iso-8859-1"?>';
$xml.='<?xml-stylesheet type="text/xsl" href="'.$File.'.xsl"?>';
$xml.='<data>';
...
$xml.='</data>';
...
header('Content-type: text/xml; charset="iso-8859-1"');
xsl
Código HTML:
<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp ' '><!ENTITY copy '©'><!ENTITY reg '®'><!ENTITY trade '™'><!ENTITY mdash '—'><!ENTITY ldquo '“'><!ENTITY rdquo '”'><!ENTITY pound '£'><!ENTITY yen '¥'><!ENTITY euro '€'>]>

<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='html' encoding='utf-8' doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' doctype-system='http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'/>
<xsl:template match='data'>

<html xmlns="http://www.w3.org/1999/xhtml">
    <body>
                   <xsl:for-each select='post'>
                        <table class="Post">
                            <tr class="Body">
                                <td><xsl:value-of select='msg'/></td>
                            </tr>						
                        </table>
                    </xsl:for-each>
    </body>
</html>

</xsl:template>
</xsl:stylesheet> 
Le saque todo lo que no tenia nada que ver asi no nos volvemos locos... gracias nuevamente!