Subject: Re: [xsl] dynamically applying templates From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 13 Sep 2004 17:35:45 -0400 |
On Sep 13, 2004, at 2:16 PM, Wendell Piez wrote:
I'm saying, in effect, there's nothing preventing you from selecting nodes in your config file, and matching them with templates, to achieve "dynamic template selection" if you want.
So you're saying match the config template and apply to mods with something like the following?
<xsl:template match="cs:title"> <xsl:apply-templates select="//mods:titleInfo"/> </xsl:template>
<xsl:template match="cs:title[parent::reftype/@name='book' and ancestor::bibliography/@author-as-sort-order='yes'> <mods:titleInfo> Creates whatever output you want for this kind of title here; make generic, if you like, by including values of @after and so forth in place of literals.... </mods:titleInfo> </xsl:template>
<bibliography author-as-sort-order="yes"> <entry> <reftype name="book"> <title font-style="italic" after=", "/> [etc.] </reftype> </entry> </bibliography>
<xsl:template match="cs:title"> <xsl:apply-templates select="//mods:titleInfo" mode="bib"/> </xsl:template> ... <xsl:template match="mods:titleInfo" mode="bib"> <span class="title"> <xsl:apply-templates/> </span> </xsl:template>
<xsl:template match="cs:citation"> <mods:titleInfo> ... </mods:titleInfo> </xsl:template>
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] Sum produces NaN, David Carlisle | Date | Re: [xsl] Namespace problem, Marc Schneider |
Month |