Subject: Re: [xsl] dynamically applying templates From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 14 Sep 2004 14:13:57 -0400 |
So perhaps your calling template would select the appropriate cs:reftype element in the config file to process:
<xsl:apply-templates name="style-biblio"
select="$styles/cs:citationstyle/cs:content/cs:bibliography[@author- as-sort-order='yes']/cs:entry/cs:reftype[@name='book']">
<xsl:with-param name="source" select="."/>
</xsl:apply-templates>
The "calling template" in this case being the mods namespaced stuff?
E.g.:
<xsl:template match="mods:mods">
<xsl:apply-templates
select="$styles/cs:citationstyle/cs:content/cs:bibliography[@author-as- sort-order='yes']/cs:entry/cs:reftype">
<xsl:with-param name="source" select="."/>
</xsl:apply-templates>
</xsl:template>
Note also that the name attribute on the apply-templates element is invalid.
OK, so with respect both of your comments below (as well as the above), I'm still a bit fuzzy on how to use parameters -- how you're using them in this context -- and about tunneling ...
And then
<xsl:template match="cs:reftype"> <xsl:param name="source"/> <xsl:apply-templates> <xsl:with-param name="source" select="."/>
In this case, what exactly is the parameter doing? Are you using this precisely to do the, as you later say, "jumping back and forth between the trees"? So here you're apply-templates to the cs:* elements, and elsewhere to mods:*?
<!-- the parameter passing shouldn't be necessary w/ XSLT 2.0 'tunneling parameters' -->
So are you saying here I should be defining a "source" param at the top of my stylesheet using tunneling='yes", without a select statement?
</xsl:apply-templates> </xsl:template>
<xsl:template match="cs:title"> <xsl:param name="source"/> <!-- do your title thing here, grabbing data from $source (the mods source) as necessary --> </xsl:template>
Here's I'm confused on the $source reference. Does this suggest I am using the source param and doing something like so?
<xsl:template match="cs:title"> <xsl:param name="source"/> <!-- do your title thing here, grabbing data from $source (the mods source) as necessary --> <xsl:apply-templates select="mods:titleInfo"> <xsl:with-param name="source" select="mods:mods"/> </xsl:apply-templates> </xsl:template>
Sorry, but I feel like a blind man here, and I need to understand it better before I get farther.
The output I'm currently getting is just:
<html xmlns="http://www.w3.org/1999/xhtml"><span class="creator"></span><span class="creator"></span><span class="creator"></span><span class="creator"></span></html>
.... which is a big mess! Probably means beyond the basic problem of how to select the right template, I also need to use modes (there's only one "creator" in this file).
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
--+------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> --+--
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] dynamically applying temp, Bruce D'Arcus | Thread | Re: [xsl] dynamically applying temp, Bruce D'Arcus |
Re: [xsl] dynamically applying temp, Bruce D'Arcus | Date | RE: [xsl] limit number of row retur, Tham Tinh |
Month |