On 2005-05-05 13:20:19 -0400, Jonathan Linczak <[EMAIL PROTECTED]> said:
On May 5, 2005, at 12:38 PM, Sean Fulton wrote:
On 2005-05-05 11:25:51 -0400, Jonathan Linczak <[EMAIL PROTECTED]> said:
Well it's not the utterly coherent prose of your blog articles but it definitely helps :)<clear, detailed explanation of how Jon varies styles across his site deleted>
I think I just want to use a different presentation XSLT depending where you are in the site hierarchy. It's not so much about the navigation, though that may come up.
Do you have an example of how you match where you are in the hierarchy. I'm still wrapping my head around XPath. Everytime I think I understand it, I see something new that makes me scratch my head.
Thanks, Jon! Now I really get what you're doing.
So, you're matching on a doctype, then in the XSLT transfom finding where you are and applying an appropriate CSS. Yes?
I think I want to use a different pipeline and xslt transform for each section because I want to change more than just the CSS. So, I tried adding a pipeline like so:
<map:pipeline>
<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
<map:match pattern="lenyabody-*/*/*/*/section/subsection**">
<map:aggregate element="cmsbody">
<map:part src="cocoon://navigation/{2}/{3}/breadcrumb/section/ subsection{5}.xml"/>
<map:part src="cocoon://navigation/{2}/{3}/tabs/section/subsection{5}.xml"/>
<map:part src="cocoon://navigation/{2}/{3}/menu/section/subsection{5}.xml"/>
<map:part src="cocoon://navigation/{2}/{3}/search/section/subsection{5}.xml"/>
<map:part src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document- path}"/>
</map:aggregate>
<map:transform src="xslt/page2xhtml-networking.xsl">
<map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
<map:parameter name="url" value="section/subsection{5}"/>
<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>
Which seems to be working. Do you see any potential gotchas with this approach?
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?
Thanks for your help.
Sean
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
