Subject: Re: Output in XML / HTML, double tags and CDATA in script.
From: Andrew Ferk <andrewferk@xxxxxxxxx>
Date: Tue, 17 Feb 2009 11:59:32 -0600
|
On Tue, Feb 17, 2009 at 11:20 AM, sOLOWXEW aNDREJ
<solovev@xxxxxxxxxxxxxx> wrote:
> Is there any way to solve this problem? I need "<br/>" style tags in my
> result html and working script.
The xsl code below should work for you.
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:php="http://php.net/xsl"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes" />
<xsl:template match="/">
<html>
<body>
<xsl:text disable-output-escaping="yes">
<script language="Javascript">
//<![CDATA[
if(1 == 1 & 2 == 2)
alert(1);
//]]>
</script>
</xsl:text>
<br/>
<img src="test.jpg"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
--
Andrew Ferk
|