On May 5, 2005, at 2:56 PM, Sean Fulton wrote:
Hmm, I definitely see what you are trying to accomplish, and I don't see that could be a problem. You'll just have multiple pipelines, which typically isn't bad as long as you don't have a million of them! :) I was thinking you might be able to stretch this out even farther and use the subsection name in the name of the XSLT file, but I'm not sure how easy that will be for you. It all depends on your setup. So, for example, you might be able to do as such:
<map:pipeline>
<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
<map:match pattern="lenyabody-*/*/*/*/*/**">
<map:aggregate element="cmsbody">
<map:part src="cocoon://navigation/{2}/{3}/breadcrumb/{5}/{6}.xml"/>
<map:part src="cocoon://navigation/{2}/{3}/tabs/{5}/{6}.xml"/>
<map:part src="cocoon://navigation/{2}/{3}/menu/{5}/{6}.xml"/>
<map:part src="cocoon://navigation/{2}/{3}/search/{5}/{6}.xml"/>
<map:part src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document- path}"/ >
</map:aggregate>
<map:transform src="xslt/page2xhtml-{5}.xsl">
<map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
<map:parameter name="url" value="{5}/{6}"/>
<map:parameter name="document-id" value="{page-envelope:document-id}"/>
<map:parameter name="document-type" value="{page-envelope:document-type}"/>
</map:transform>
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{1}"/>
<map:when test="view">
<map:transform type="link-rewrite"/>
</map:when>
</map:select>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
So, the section you mention is {5} and subsection is {6}, and if your section defines a different XSLT file, then you reference page2xhtml-{5}.xsl, and then create XSLT files for each section in pubname/xslt/. Or something similar, if possible.
Jon
I like that idea and it could work to generalize things a bit if I can pass some parameters to the transform. How can I get the dc:title of the section or subsection? It seems it should be possible with XPath. I can't figure out the correct syntax. Any ideas?
Well, it actually should be pretty easy to grab the title straight in the XSLT file without changing anything from the default pipeline. In your XSLT file, you just need to call the following:
<xsl:value-of select="//lenya:meta/dc:title"/>
wherever you need it. If you are using it to decide some other layout options rather than just displaying it someplace, I think you can just use it in a choose or if statement, like so:
<xsl:choose>
<xsl:when test="<xsl:value-of select="//lenya:meta/dc:title"/> == "Something">
... HTML stuff here ...
</xsl:when>
<xsl:otherwise>
... HTML stuff here ...
</xsl:otherwise>
</xsl:choose>
I'm not 100% sure of this as I haven't tested it myself, but if it doesn't, you might try assigning it to a parameter or something and testing from there. Just some thoughts to throw out there to try.
Jon
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
