On Tue, 12 Nov 2002 13:43:42 +0100 (CET)
Jakob Praher <[EMAIL PROTECTED]> wrote:

> hi all,
> 
> is it possible to access a sitemap parameter, within
> the cinclude tag in a page like this:
> 
> sitemap:
> 
> <map:match pattern="composite/**">
>    <map:generate src="aggreate.xml" />
>    <map:transform type="cinclude">
>       <map:parameter name="uri" value="cocoon:/{1}" />
>    </map:transform>
>    <map:serialize/>
> </map:match>
> 
> aggregate.xml
> 
> <page>
>    <cinclude:include src="{uri}" ... />
> </page>
> 

Try like:

 <map:match pattern="composite/**">
    <map:generate src="aggreate.xml" />
    <map:transform src="sample.xsl">
       <map:parameter name="uri" value="cocoon:/{1}" />     
    </map:transform>
    <map:transform type="cinclude"/>
    <map:serialize/>
 </map:match>

sample.xsl

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:ci="http://apache.org/cocoon/include/1.0";
  version="1.0">

  <xsl:output method="xml"/>

  <xsl:param name="uri"/>

  <xsl:template match="/">
    <xsl:apply-templates select="page"/>
  </xsl:template>

  <xsl:template match="page">
   <page>
    <cinclude:include src="{$uri}" ... />
   </page>
  </xsl:template>

    <xsl:template match="*">
      <!-- remove element prefix (if any) -->
      <xsl:element name="{local-name()}">
        <!-- process attributes -->
        <xsl:for-each select="@*">
          <!-- remove attribute prefix (if any) -->
          <xsl:attribute name="{local-name()}">
            <xsl:value-of select="."/>
          </xsl:attribute>
        </xsl:for-each>
        <xsl:apply-templates/>
      </xsl:element>
  </xsl:template>

</xsl:stylesheet>


-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

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

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to