You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Miklos Pocsaji <mi...@gmail.com> on 2005/04/26 12:16:50 UTC

page-envelope:document-type

Hi,

Thanks for the answer for my previous question!
Here is my next problem:
I've got a simple pipeline:
   <map:pipeline>
        <!-- {document-type}/{url} -->
        <map:match pattern="transform2wml/*/**">
            <map:generate src="...{2}..."/>
            <map:transform src="xslt/{1}2wml.xsl"/>
            <map:serialize type="xml"/>
        </map:match>
    </map:pipeline>


And here is the code I want use it:
<map:generate src="cocoon:/transform2wml/{page-envelope:document-type}/..."/>

The first pipeline matches for this generate EXCEPT when I pass this
{page-envelope:document-type} thing. I need to know the type of the
document in the first pipeline but it does not even match for it. When
I write area/document-id/... anything else after page-envelope it
matches...
How can this be? I'm rather confused.

Thanks in advance, 
Miklos Pocsaji.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: page-envelope:document-type

Posted by so...@gmail.com.
On 4/26/05, Miklos Pocsaji <mi...@gmail.com> wrote:
> I've got a simple pipeline:
>    <map:pipeline>
>         <!-- {document-type}/{url} -->
>         <map:match pattern="transform2wml/*/**">
>             <map:generate src="...{2}..."/>
>             <map:transform src="xslt/{1}2wml.xsl"/>
>             <map:serialize type="xml"/>
>         </map:match>
>     </map:pipeline>
> 
> And here is the code I want use it:
> <map:generate src="cocoon:/transform2wml/{page-envelope:document-type}/..."/>
> 
> The first pipeline matches for this generate EXCEPT when I pass this
> {page-envelope:document-type} thing. I need to know the type of the
> document in the first pipeline but it does not even match for it. When
> I write area/document-id/... anything else after page-envelope it
> matches...
> How can this be? I'm rather confused.
> Miklos Pocsaji.

1. Does the correct XSLT exist?  Try replacing
{page-envelope:document-type} with the expected doctype.  If that
works then it is #2.

2. {page-envelope:document-type} is decided by parameter-doctype.xmap.
 Is there a match in parameter-doctype.xmap for the URL you are
testing?  Some documentation is at:
http://www.solprovider.com/solprovider/lenya.nsf/Home?readform&cat=&pg=doctype

To see what doctype is being set, add this to the top of your
publication-sitemap.xml:
        <map:match pattern="**">
           <map:generate src="../../content/util/empty.xml"/>
           <map:transform src="doctype.xsl">
          <map:parameter name="doctype" value="{page-envelope:document-type}"/>
           </map:transform>
           <map:serialize type="html"/>
       </map:match>

doctype.xsl:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xsl:param name="doctype"/>
<xsl:template match="/">
<html><body>
DOCTYPE=<xsl:value-of select="$doctype"/>
</body></html>
</xsl:template>

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org