[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: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 16 Sep 2004 12:00:27 -0400
free counter strike templates
Bruce,

At 01:22 AM 9/16/2004, you wrote:
        <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>

As you surmised, $source should refer to the node in the mods data, not the cs data, so this should be


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

As you traverse down the branches of the cs: tree, you need to keep track of what branch of the mods: tree you were in before you jumped into the other tree, so that inside these templates you can get their data.

If we could talk this true at a whiteboard I could make this clear in a minute ... unfortunately, as I said, this processing-two-trees stuff is like XSLT on steroids.

In any case, yes ...

.... 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?

Exactly right.


Tunneling parameters would only mean that your cs:origin template need not actually declare and pass $source, so

<xsl:template match="cs:origin">
  <xsl:apply-templates/>
</xsl:template>

(i.e. the built-in template) would work as well as what I have above.

Bob DuCharme has a nice column about tunneling parameters on XML.com:
http://www.xml.com/pub/a/2004/03/24/tr.html

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

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.