[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: Wed, 15 Sep 2004 14:46:33 -0400
bibliography templates
Thanks Wendell (again!). A couple of minor things below:

On Sep 15, 2004, at 2:05 PM, Wendell Piez wrote:

Accordingly, change this template to read:

<xsl:template match="/">
  <html>
    <div>
      <xsl:apply-templates/>
   </div>
  </html>
</xsl:template>

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

I'll explain this more fully below, but the original (non-configurable) version of the stylesheets had two modes that mods:mods was invoked in: bibliography and citation.


Within those templates, there were two core modes: full and short. Originally, I had carried the citation/bibliography thing through the descendants, but that doesn't really make much sense when you consider footnote citations are often full bib references. Hence, full and short (for titles, names, etc.).

I tend to think this logic makes sense to keep.

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

How and why? ;-)


Note: I do have a function (again, with Jeni's help) that determines the type of mods record (book, etc.), but I've not thought about whether and how to bring that over to the cs:* stuff. There the type is just a straight attribute value.

    <xsl:with-param name="source" select="."/>
    <!-- this is where we jump to the other tree, carrying the original
       context with us as the $source -->

Original context is mods:mods? I am jumping to the other tree with the select statement on the apply-templates, and then jumping back to mods:mods using the with-param select?


Also, a niggle: any particular reason why your configuration couldn't be

<bibliography author-as-sort-order="yes">
  <entry reftype="book">
    <title font-style="italic" after=", "/>
    <creator/>
  </entry>
</bibliography>

thereby making it a bit tighter and easier to handle?

I simplified the config file a lot here to keep it as clear as possible. The full structure would be schematically:


citationstyle
	info (the metadata)
	content
		names
		terms
		citation
		bibliography

So, the business I'm dealing with here relates to just the last two, and needs to happen in two respective modes: citation and bibliography. All else are straightforward variables and parameters, which I already have pretty well figured out.

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.