From: Conal Tuohy <[EMAIL PROTECTED]>

Sonny Sukumar wrote:

> Now here's the more general thing I'd like to do... The XML doc I'm
> transforming has a tag like this:
>
> <rp:content replace-with="navigationMenu"/>
>
> and, using my XSL stylesheet, I want to transform it to this:
>
> <cinclude:include src="someSpecificSourceName"/>
>
> The catch (and why I'm using xsl:params) is that the "src" for the
> <cinclude:include> should be an xsl:param passed into the XSL
> stylesheet
> with the "navigationMenu" name (in this example).
>
> So I'm trying to write a template to do this.  Here's what
> I'm trying, but
> is not working:
>
> <xsl:template match="rp:[EMAIL PROTECTED]">
>   <cinclude:include src="[EMAIL PROTECTED]"/>
> </xsl:template>
>
> This is the output:
>
> <cinclude:include
> xmlns:cinclude="http://apache.org/cocoon/include/1.0";
> src=""/>
>
> Note the src="".  What am I doing incorrectly?

You can't do nested attribute values in XSLT. It seems to me you should just
use:


<xsl:template match="rp:[EMAIL PROTECTED]'navigationMenu']">
  <cinclude:include src="{$navigationMenu}"/>
</xsl:template>


Ahh darn. It seems ironic that a recursive language like XSLT doesn't support nesting of brackets like this. Do you know if there is a fundamental reason for this, or is it something that hasn't been implemented in the XSLT spec yet? XSLT has been around for awhile, so I think if it were going to have this feature, it probably already would have.


Anyhow, while it's disappointing that I can't do a more general version (to match all possible "replace-with" strings), this will work for my current needs.

Thanks for all of your help, and I'll post again if I have some more problems with this.

Best regards,

Sonny

_________________________________________________________________
Try MSN Messenger 6.0 with integrated webcam functionality! http://www.msnmessenger-download.com/tracking/reach_webcam



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to