[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: dynamically applying templates

Subject: Re: dynamically applying templates
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Thu, 16 Sep 2004 01:22:16 -0400
Re:  dynamically applying templates
On Sep 15, 2004, at 2:05 PM, Wendell Piez wrote:

.... and add a template to match mods:mods (but notice I pulled the mode, imagining that the "bibliography" mode is to handle nodes in the config document.

That's the template where we'll jump trees, so --

<xsl:template match="mods:mods">
<xsl:apply-templates select="$style-biblio/cs:entry/cs:reftype[@name='book']"
mode="bibliography">
<!-- of course the value 'book' should probably be parameterized -->
<xsl:with-param name="source" select="."/>
<!-- this is where we jump to the other tree, carrying the original
context with us as the $source -->
</xsl:apply-templates>
</xsl:template>


.... see where that gets you ...

OK, this works fine when I am matching a cs:* template and then from there applying to mods:*.


However, it doesn't work when I need to apply templates to a cs: child. For example, the cs:origin element here:

	<reftype name="book">
	  <title font-style="italic" after=", "/>
	  <creator>
	    <names form="full"/>
	  </creator>
	  <origin before="(" after="), ">
	    <place after=":"/>
	    <publisher/>
	  </origin>

With this template ...

<xsl:template match="cs:origin">
  <xsl:param name="source"/>
  <xsl:apply-templates>
    <xsl:with-param name="source" select="."/>
  </xsl:apply-templates>
</xsl:template>

.... am I right that I am passing cs:origin as the source to the children, where I really need to be passing the original mods:mods source. A child looks like:

<xsl:template match="cs:place">
  <xsl:param name="source"/>
  <xsl:apply-templates select="$source/mods:originInfo/mods:place"/>
</xsl:template>

I'm not sure, but is this where tunneling should come in? And if yes, how do I actually use it in this context?

Bruce

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.