You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Navneet Joneja <Na...@Techspan.com> on 2001/04/26 04:01:14 UTC

Special characters in XSL....

Hi all,
I'm trying to use Cocoon & XSL to output a doctype declaration to the target
file but I can't get it to print any of the special characters... which
includes < and >. If I put entity references, the parser throws up. If I use
a CDATA section, I get &lt; and &gt; in the output stream. Is this a bug? Or
is there some other way to do this?
Thanks!!!
- Navneet

<?xml version="1.0"?>

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
  extension-element-prefixes="redirect"
>
<xsl:template match="/">
<xsl:apply-templates select="/task-list"/>
</xsl:template>

<xsl:template match="/task-list">
<xsl:processing-instruction
name="cocoon-format">type="text/xml"</xsl:processing-instruction>
<html>
<xsl:value-of select='concat(./task/id,".xml")'/> written
</html>
<redirect:write select='concat("e:\tasks\",./task/id,".xml")'>
<![CDATA[ <!DOCTYPE task SYSTEM "task.dtd">]]>
<xsl:copy-of select="./task"/>
</redirect:write>
</xsl:template>
</xsl:stylesheet>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Special characters in XSL....

Posted by Scott Sanders <sa...@totalsync.com>.
if you look at the XSL spec, you can use the xsl:text tag with 
disable-output-escaping='yes'.  Double check it, as I just wrote that 
from memory.


Scott Sanders

Navneet Joneja wrote:

> Hi all,
> I'm trying to use Cocoon & XSL to output a doctype declaration to the target
> file but I can't get it to print any of the special characters... which
> includes < and >. If I put entity references, the parser throws up. If I use
> a CDATA section, I get &lt; and &gt; in the output stream. Is this a bug? Or
> is there some other way to do this?
> Thanks!!!
> - Navneet
> 
> <?xml version="1.0"?>
> 
> <xsl:stylesheet
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>   xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
>   extension-element-prefixes="redirect"
> 
> <xsl:template match="/">
> <xsl:apply-templates select="/task-list"/>
> </xsl:template>
> 
> <xsl:template match="/task-list">
> <xsl:processing-instruction
> name="cocoon-format">type="text/xml"</xsl:processing-instruction>
> <html>
> <xsl:value-of select='concat(./task/id,".xml")'/> written
> </html>
> <redirect:write select='concat("e:\tasks\",./task/id,".xml")'>
> <![CDATA[ <!DOCTYPE task SYSTEM "task.dtd">]]>
> <xsl:copy-of select="./task"/>
> </redirect:write>
> </xsl:template>
> </xsl:stylesheet>
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Special characters in XSL....

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 25 Apr 2001, Navneet Joneja wrote:

> Hi all,
> I'm trying to use Cocoon & XSL to output a doctype declaration to the target
> file but I can't get it to print any of the special characters... which
> includes < and >. If I put entity references, the parser throws up. If I use
> a CDATA section, I get &lt; and &gt; in the output stream. Is this a bug? Or
> is there some other way to do this?

edit cocoon.properties and define your own cocoon-format type. declare
your page to be of that type using the cocoon-format pi.

- donald


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>