You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Z.Z." <za...@vili.pmmf.hu> on 2004/02/07 18:48:14 UTC

newbie map:parameter question

Hello,

I try to make "Style-Free Stylesheets with Cocoon" template base sites, but 
I breaked :-(
I can pass template file name to xsl, but it cannot load.

my directory structure is:
          /   
         |   sitemap.xmap
         |  
         + styles
         |      logic2.xsl
         | 
         + templates
                layout.xml

my sitemap.xml is:
   <map:match pattern="">
     <map:generate src="content.xml"/>
     <map:transform src="styles/logic2.xsl">
       <map:parameter name="template" value="templates/layout.xml"/>
     </map:transform>
     <map:serialize/>
   </map:match>

my logic2.xsl snippet is:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:param name="template"/>
    <xsl:variable name="layout" select="document($template)"/>

    <!-- xsl:variable name="layout" 
select="document('../templates/layout.xml')"/ -->

    <xsl:variable name="page" select="/"/>

When I uncomment <xsl:variable name="layout" 
select="document('../templates/layout.xml')"/>
its working good, but the result of  <xsl:variable name="layout" 
select="document($template)"/> is an empty html:
-----------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
----------------------------------------------------------------------
-- 
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: newbie map:parameter question

Posted by "Z.Z." <za...@vili.pmmf.hu>.
Hello,
Problem solved:
   <xsl:variable name="layout" select="document($template)"/> 
is not good, the solving is:
   <xsl:variable name="layout" select="document( concat('../', 
$template) )"/> 


2004. február 7. 18.48 dátummal Z.Z. ezt írta:
> Hello,
>
> I try to make "Style-Free Stylesheets with Cocoon" template base sites,
> but I breaked :-(
> I can pass template file name to xsl, but it cannot load.
>
> my directory structure is:
>           /
>
>          |   sitemap.xmap
>
>          + styles
>
>          |      logic2.xsl
>
>          + templates
>                 layout.xml
>
> my sitemap.xml is:
>    <map:match pattern="">
>      <map:generate src="content.xml"/>
>      <map:transform src="styles/logic2.xsl">
>        <map:parameter name="template" value="templates/layout.xml"/>
>      </map:transform>
>      <map:serialize/>
>    </map:match>
>
> my logic2.xsl snippet is:
>
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
>     <xsl:param name="template"/>
>     <xsl:variable name="layout" select="document($template)"/>
>
>     <!-- xsl:variable name="layout"
> select="document('../templates/layout.xml')"/ -->
>
>     <xsl:variable name="page" select="/"/>
>
> When I uncomment <xsl:variable name="layout"
> select="document('../templates/layout.xml')"/>
> its working good, but the result of  <xsl:variable name="layout"
> select="document($template)"/> is an empty html:
> -----------------------------------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
> Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
> ----------------------------------------------------------------------

-- 
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org