cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Tessner <r...@juno.myra.com>
Subject Re: One XML doc, two presentations (HTML & PDF)
Date Sun, 02 Jul 2000 16:13:21 GMT
On Sun, 02 Jul 2000 10:25:33 +0200, "Nicola Ken Barozzi" wrote:

>Well, I knew I needed it too but now that you need it too I got myself to do
>it! (crazy sentence!)
>I tried it on my 1.74 cocoon and it works, I just changed the names for you.
>
>Then here is blat.xsl:
>
><?xml version="1.0"?>
><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>>
>
> <!-- this is internal reference to the "print" in the url -->
> <xsl:param name="print"/>
>
> <xsl:template match="/">
>  <xsl:choose>
>   <!-- when "print" is specified ... -->
>   <xsl:when test="$print">
>    <xsl:processing-instruction name="xml-stylesheet">href="blat-fo.xsl" type=
>"text/xsl"</xsl:processing-instruction>
>    <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:process
>ing-instruction>
>   </xsl:when>
>   <xsl:otherwise>
>    <xsl:processing-instruction name="xml-stylesheet">href="blat-html.xsl" typ
>e="text/xsl"</xsl:processing-instruction>
>    <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:process
>ing-instruction>
></xsl:otherwise>
>  </xsl:choose>  
> 
>    <xsl:apply-templates/>
>
> </xsl:template>
>
> <!-- copy everyting else except processing instructions; be careful if you ne
>ed them...-->
>  <xsl:template match="@*|*|text">
>    <xsl:copy>
>      <xsl:apply-templates select="@*|*|text"/>
>    </xsl:copy>
>  </xsl:template>
>
></xsl:stylesheet>
>
>Here it is!
>
>I don't know if it's the best way, but it works. :-)
>
>Ken

Thanks muchly!  Almost worked for me.  For some reason, it wasn't
emitting my text nodes, only the elements and attributes.  So,
I changed the

  <xsl:template match="@*|*|text">
    <xsl:copy>
      <xsl:apply-templates select="@*|*|text"/>
    </xsl:copy>
  </xsl:template>

to
  <xsl:template match="@*|*|text">
    <xsl:copy-of select="."/>
  </xsl:template>   

and now it works wonderfully!  Thanks again!!

-- 
Rick Tessner	rick@myra.com
MYRA Systems Corp. Fone: (250) 381 1335 x125  Phax: (250) 381 1304
                   Cell: (250) 885 9452

"Hmmm.  They have the Internet on computers now!"



Mime
View raw message