cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From M. Amin <a...@imkenberg.net>
Subject How can i dynamically apply correctly xsl stylesheet to xml file ?
Date Fri, 18 May 2001 02:13:54 GMT
Dear All,
 i tried to apply xsl file to xml file by using the following code

<xsl:template match="page">

 <xsl:variable name="lang">
    <xsl:value-of select="locale/lang"/>
   </xsl:variable>

   <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
   <xsl:processing-instruction name="xml-stylesheet">
    href="<xsl:choose>
          <xsl:when test="$lang='ar'">Categories_ar.xsl</xsl:when>
          <xsl:otherwise>Imkenberg-Categories.xsl</xsl:otherwise>
   </xsl:choose>
   "type="text/xsl"
  </xsl:processing-instruction>

  <xsl:copy>
   <xsl:apply-templates select="@*" />
   <xsl:apply-templates select="node()" />
  </xsl:copy>
 </xsl:template> 

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

but the data in the xml file dumped without a stylesheet applied to it.

Any help will be appreciated.

Regards,
 M. Amin

---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message