cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "peter" <pe...@silmaril.ie>
Subject Re: Knowledge of sitemap from input module
Date Mon, 27 Mar 2006 13:35:57 GMT
On Sun, 26 Mar 2006 20:40:26 -0500, Tim Williams wrote
> How might I figure out what the calling sitemap is for a given input
> module request?  In other words if I have: lm:my.resource, how could 
> I figure out that that this request happens to be coming from some-
> mounted-sitemap.xmap?  We basically want this to be output for 
> debugging information[1].

sitemap.xmap files are all XML, so (if n>1 and you know their locations),
you could scan them in turn in XSLT with something like

   <xsl:param name="myresource"/>
...
   <xsl:choose>
     <xsl:when test="document('/path/to/potential/sitemap.xmap')
                //map:match[contains(@pattern,$myresource)]">
       do stuff
     </xsl:when>
     ...more whens...
     <xsl:otherwise>
       dunno how we got here
     </xsl:otherwise>
   </xsl:choose>

But it will be fairly slow...and tedious to maintain, and you'd need to
be able to pattern-match the @pattern, which is probably non-trivial in
XSLT 1.0.

Maybe edit your sitemaps to pass a parameter to all transformations
identifying the location of the sitemap that matched?

///Peter

///Peter

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


Mime
View raw message