Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recursive XSL in Serna?

Status
Not open for further replies.

thenewa2x

Programmer
Dec 10, 2002
349
US
I use an editor for creating XML documents and Serna uses XSLT 1.0 for on-the-fly transformations.

I created a template for a document that we will be working on and it all works fine except that subsequent lists (anything after list1 such as list2, list2red, list3, list3red, etc...) is not rendered eveen though I have [tt]<xsl:apply-templates />[/tt].

Here is a sample document:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<qld>
  <title>Generalized Anxiety Disorder</title>
  <sidematter>
    <authors>
      <authorslabel>Author</authorslabel>
      <authorslist>
        <author>
          <authorname>Penny D. March, Psy.D.</authorname>
        </author>
      </authorslist>
    </authors>
    <reviewers>
      <reviewerslabel>Reviewers</reviewerslabel>
      <reviewerslist>
        <reviewer>
          <reviewername>Sonia Singla</reviewername>
          <reviewertitle>, DO</reviewertitle>
          <reviewerposition>Director of Clinical Operations</reviewerposition>
          <revieweraffiliation>Clinical Management Services</revieweraffiliation>
          <reviewerlocation>Glendale, California</reviewerlocation>
        </reviewer>
        <reviewer>
          <reviewername>Mark Mitchell</reviewername>
          <reviewertitle>, MD</reviewertitle>
          <reviewerposition>Staff Physician, Internal Medicine</reviewerposition>
          <revieweraffiliation>Providence Health Systems of Washington State</revieweraffiliation>
          <reviewerlocation>Everett, Washington</reviewerlocation>
        </reviewer>
      </reviewerslist>
    </reviewers>
  </sidematter>
  <body>
    <sections>
      <section>
        <sectionlabel>Description/Etiology</sectionlabel>
        <sectioncontent>Generalized anxiety disorder (GAD) is the most common form of anxiety disorder. Spanning the life cycle, symptoms progress gradually and are hallmarked by difficulty controlling excessive, unrealistic, and chronic worry and anxiety in response to daily functioning, decision-making, and stressors. Patients may also present with somatic complaints and a preoccupation with or neglect of self-care. Symptoms must have been present for a period of at least 6 months and must include at least three of the following: frequent headaches, stomach aches, muscle tension, sweating, hot flashes, fatigue, sleep disturbances, poor concentration, irritability, and apprehension. Symptoms must be differentiated from and not exclusively attributable to the occurrence of panic attacks or the existence of comorbid mental disorders such as post-traumatic stress disorder, mood disorders, psychotic disorder, or pervasive developmental disorder. Diagnostic criteria for GAD require the presence of symptoms that would exclude other mental health disorders such as social phobias, obsessive-compulsive disorder, separation-anxiety disorder, somatic concerns, and/or a serious medical condition. However, a high comorbidity rate with depressive disorders necessitates a thorough assessment for GAD. Medical conditions that may simulate GAD symptoms include acute myocardial infarction, caffeine intoxication, hypoglycemia, substance intoxication and withdrawal, and complex partial seizures.</sectioncontent>
      </section>
      <section>
        <sectionlabel>Risk Factors</sectionlabel>
        <sectioncontent>Precipitating factors may include female gender, a history of poor coping skills, familial mood or anxiety disorders, and other underlying mental health disorders, including early-childhood anxiety symptoms, which may increase predisposition for the disorder later in life. Due to high comorbidity rates of GAD with depressive disorders such as major depressive disorder and dysthymic disorder, the risk of developing GAD increases, particularly in response to life stressors, poor social support, low socioeconomic status, poor self-esteem, and limited health care options. Studies also place asthmatic patients at a higher risk for developing GAD, while patients with chronic daily headache or traumatic brain injuries have twice the risk of developing symptoms.</sectioncontent>
      </section>
      <section>
        <sectionlabel>Facts &amp; Figures</sectionlabel>
        <sectioncontent>About 4 million American adults between the ages of 18 and 54 suffer from GAD, which generally cooccurs with medical or other mental health-related issues, such as panic attacks. Hormonal factors and the willingness to openly discuss symptoms means women are twice as likely as men to be diagnosed with GAD. Children and middle-aged adults are at a higher risk of developing symptoms, but the elderly (+65) have a significantly higher risk, with diagnosis rates ranking 4 to 8 times higher than those for depressive disorders. Research suggests a strong genetic component for GAD, with concordance rates at 30% for identical twins and at 10 to 20% in close relatives. Hereditary aspects of GAD, and anxiety disorders in general, have been linked to a protein called cholecystokinin, which can induce panic attacks when injected.</sectioncontent>
      </section>
      <section>
        <sectionlabel>Signs &amp; Symptoms/Clinical Presentation</sectionlabel>
        <sectioncontent>
          <list1>
            <list1item>GAD patients have feelings of anxiety and somatic concerns, with infrequent physiological basis</list1item>
            <list1item>
              <italics>Physical indicators</italics>: trembling, dizziness, agitation, headaches, hyperventilation, dry mouth, and autonomic arousal that heightens patient’s anxious symptoms</list1item>
            <list1item>
              <italics>Cognitive indications</italics>: poor coping skills, performance anxiety, hypersensitivity to criticism, inability to concentrate, and a generalized negative outlook</list1item>
            <list1item>Symptoms cannot be directly related to substance use or abuse</list1item>
          </list1>
        </sectioncontent>
      </section>
      <section>
        <sectionlabel>Assessment</sectionlabel>
        <sectioncontent>Physical and mental health history will help determine possible comorbidity and distinguish if the condition is anxiety-based or due to a general medical condition.
          <list1>
            <list1label>Physical Findings of Particular Interest</list1label>
            <list2>
              <list2item>Sweaty palms, hyperventilation, headaches, rapid heart rate, dry mouth, or trembling</list2item>
            </list2>
            <list1label>Laboratory Tests That May Be Ordered</list1label>
            <list2>
              <list2item>Urinalysis to rule out organic-based anxiety conditions; drug testing to ensure the absence of substances that may mimic GAD symptoms</list2item>
              <list2item>CBC and T<sub>3</sub>, T<sub>4</sub>, TSH to rule out anemia and hyperthyroidism</list2item>
              <list2item>Blood glucose to rule out hypoglycemia, which can mimic anxiety symptoms</list2item>
            </list2>
            <list1label>Other Diagnostic Tests/Studies</list1label>
            <list2>
              <list2item>ECG to measure the rate/regularity of heart rate and distinguish between possible cardiovascular disease symptoms and anxiety symptoms</list2item>
              <list2item>Pulmonary function test to rule out asthma attacks, masked as anxiety symptoms</list2item>
              <list2item>Psychological assessment tools such as the Hamilton Rating Scale for Depression (HAM-D), the Hamilton Anxiety Scale (HAS), the Penn State Worry Questionnaire (PSWQ), and Beck’s Anxiety Inventory (BAI) may help differentiate between depression and anxiety and determine the severity of symptoms</list2item>
              <list2itemred>Assess for suicidal ideation and level of threat to self and others</list2itemred>
            </list2>
          </list1>
        </sectioncontent>
      </section>
      <section>
        <sectionlabel>Treatment Goals</sectionlabel>
        <sectioncontent>
          <list1>
            <list1label>Alleviation of Anxiety</list1label>
            <list2>
              <list2item>If presenting symptoms are severe or accompanied by panic attacks, remove patient from stimulating environment</list2item>
              <list2item>Demonstrate relaxation techniques (deep breathing exercises, visualization, stretching/physical activity to relax muscles) to increase a sense of self-control</list2item>
              <list2item>Assess patient’s treatment preference (counseling, medications, or self-management tools) to determine the most effective treatment options and increase chances of follow through</list2item>
              <list2item>Clinician may order medications including benzodiazepines (e.g., alprazolam, lorazepam) for immediate reduction of severe symptoms, such as panic attacks, or the more effective long-term management drug, venalfaxine XR (Effexor-XR)</list2item>
            </list2>
            <list1label>Encourage Self-Management to Decrease Recurrence of Severe Symptoms</list1label>
            <list2>
              <list2item>Recommend decrease or cessation of caffeine intake until symptoms are in remission</list2item>
              <list2item>Referral to a mental health therapist is recommended</list2item>
              <list2item>Suggest a follow-up appointment to reassess condition, monitor severity of symptoms, and evaluate response to prescribed medication(s)</list2item>
            </list2>
          </list1>
        </sectioncontent>
      </section>
      <section>
        <sectionlabel>Food for Thought</sectionlabel>
        <sectioncontent>
          <list1>
            <list1item>Elevations of blood lactate may sometimes be noted in patients experiencing panic attacks as a result of GAD</list1item>
            <list1item>Drugs that elevate norepinephrine levels, such as yohimbine, may cause a significant increase in anxiety symptoms; this is particularly evident in elderly patients</list1item>
            <list1item>Self-report anxiety scales for differential diagnosis of GAD may be problematic due to underreporting of symptoms, which are often perceived as “normal� by the patient given the chronic nature of the disorder</list1item>
          </list1>
        </sectioncontent>
      </section>
      <section>
        <sectionlabelred>Red Flags</sectionlabelred>
        <sectioncontent>
          <list1red>
            <list1itemred>Benzodiazepines (e.g., alpralozam, lorazepam, clonazapine), used in cases of severe symptomology, are associated with physical dependence, memory impairment, drowsiness, and poor muscle coordination</list1itemred>
          </list1red>
        </sectioncontent>
      </section>
      <section>
        <sectionlabel>What Do I Need to Tell the Patient/Patient’s Family?</sectionlabel>
        <sectioncontent>
          <list1>
            <list1item>Provide patient with appropriate literature, such as an Anxiety Disorder Association of America booklet (available through the National Institute of Mental Health Web site: <externaldocurl>[URL unfurl="true"]http://www.nimh.nih.gov/</externaldocurl>),[/URL] to help educate patient about symptoms and treatment options</list1item>
            <list1item>Teach patient about self-monitoring for signs and symptoms of anxiety</list1item>
            <list1item>Discuss symptoms of GAD with patient and/or caregiver to provide safety measures, in case of severe symptoms that may require immediate medical care</list1item>
            <list1item>Educate patient or caregiver about prescribed medications and when to call physician if side effects develop</list1item>
          </list1>
        </sectioncontent>
      </section>
    </sections>
  </body>
  <references>
    <referenceslabel>References</referenceslabel>
    <referenceslist>
      <reference>American Psychiatric Association. (2000). <externaldocref>Diagnostic and statistical manual of mental disorders</externaldocref> (4th rev. ed.). Washington, D.C.: Author.</reference>
      <reference>Antai-Otong, D. (2003). Current treatment of generalized anxiety disorder. <externaldocref>Journal of Psychosocial Nursing, 41</externaldocref>(12), 20-29.</reference>
      <reference>Bourland, S. L., &amp; Stanley, M. A. (2000). Quality of life in older adults with generalized anxiety disorder. <externaldocref>Aging and Mental Health, 4</externaldocref>(4), 315-323.</reference>
      <reference>Fricchione, G. (2004, August 12). Generalized anxiety disorder. <externaldocref>The New England Journal of Medicine, 351</externaldocref>(7), 675-682.</reference>
      <reference>Hemetta, J. M., &amp; Prescott, C. A. (2001). A population-based twin study of generalized anxiety disorder in men and women. <externaldocref>The Journal of Nervous and Mental Disease, 189</externaldocref>(7), 413-420.</reference>
      <reference>Hiott, W. H., &amp; Labbate, L. (2002). Anxiety disorders associated with traumatic brain injuries. <externaldocref>NeuroRehabilitation, 17</externaldocref>(4), 345-55.</reference>
      <reference>McFarland, G. K. (2002). In J. M. Thomspon, G. MacFarland, J. E. Hirsch, &amp; S. M. Tucker (Eds.), <externaldocref>Mosby’s clinical nursing</externaldocref> (5th ed., pp. 1307-1309). St. Louis, MO: Mosby, Inc.</reference>
      <reference>Polsker, G. (Ed.). (2001). Venlafaxine XR: effective in long-term management of generalized anxiety disorder. <externaldocref>Drugs &amp; Therapy Perspectives, 17</externaldocref>(14), 1-16.</reference>
      <reference>Townsend, M. C. (2003). <externaldocref>Psychiatric mental health nursing</externaldocref> (4th ed., pp. 515-519). Philadelphia: F. A. Davis Company.</reference>
    </referenceslist>
  </references>
  <date>March 16, 2006</date>
  <accession>1234567890</accession>
</qld>

And here is the XSL template:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL]
                xmlns:fo="[URL unfurl="true"]http://www.w3.org/1999/XSL/Format"[/URL]
                xmlns:xse="[URL unfurl="true"]http://www.syntext.com/Extensions/XSLT-1.0"[/URL]
                xmlns:se="[URL unfurl="true"]http://syntext.com/XSL/Format-1.0"[/URL]
                version='1.0'>

  <!-- *********************************************************** -->
  <!-- *                Global Page Configuration                * -->
  <!-- *********************************************************** -->

  <!-- General Control -->
  <xsl:param name="page.font"   select="'Arial'" />
  <xsl:param name="page.height" select="'11in'"  />
  <xsl:param name="page.margin" select="'0.5in'" />
  <xsl:param name="page.size"   select="'10pt'"  />
  <xsl:param name="page.width"  select="'8in'"   />

  <!-- Document Title Control -->
  <xsl:param name="title.size"   select="'24pt'" />
  <xsl:param name="title.weight" select="'bold'" />
  <xsl:param name="title.space"  select="'10pt'" />

  <!-- Miscellaneous Title Control -->
  <xsl:param name="misc.size"   select="'16pt'" />
  <xsl:param name="misc.weight" select="'bold'" />
  <xsl:param name="misc.space"  select="'0pt'"  />

  <!-- List Control -->
  <xsl:param name="list.size.label"   select="'12pt'"   />
  <xsl:param name="list.size.item"    select="'10pt'"   />
  <xsl:param name="list.space.top"    select="'5pt'"    />
  <xsl:param name="list.space.item"   select="'2pt'"    />
  <xsl:param name="list.weight.label" select="'bold'"   />
  <xsl:param name="list.weight.item"  select="'normal'" />

  <!-- Authors Listing Control -->
  <xsl:param name="authors.space.bottom" select="'5pt'" />
  <xsl:param name="authors.space.item"   select="'5pt'" />

  <!-- Reviewers Listing Control -->
  <xsl:param name="reviewers.color"          select="'#CCCCCC'" />
  <xsl:param name="reviewers.pad.horizontal" select="'2pt'"     />
  <xsl:param name="reviewers.pad.vertical"   select="'2pt'"     />
  <xsl:param name="reviewers.space.bottom"   select="'5pt'"     />
  <xsl:param name="reviewers.thick"          select="'1pt'"     />

  <!-- References Listing Control -->
  <xsl:param name="references.space.bottom" select="'5pt'" />
  <xsl:param name="references.space.item"   select="'0pt'" />

  <!-- Section Control -->
  <xsl:param name="section.size.label"    select="'24pt'" />
  <xsl:param name="section.space.bottom"  select="'10pt'" />
  <xsl:param name="section.space.content" select="'10pt'" />
  <xsl:param name="section.space.label"   select="'10pt'" />
  <xsl:param name="section.weight.label"  select="'bold'" />

  <!-- *********************************************************** -->
  <!-- *                   Page Configuration                    * -->
  <!-- *********************************************************** -->

  <!-- Ignore Blanks -->  
  <xsl:strip-space elements="*"/>

  <!-- Layout Master -->
  <xsl:template match="/">
    <fo:root>
      <fo:layout-master-set>
        <fo:simple-page-master master-name="Letter"
                               margin="{$page.margin}"
                               page-height="{$page.height}"
                               page-width="{$page.width}">
          <fo:region-body />
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="Letter">
        <fo:flow flow-name="xsl-region-body">
          <xsl:apply-templates />
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                  Global Effect Template                 * -->
  <!-- *********************************************************** -->

  <!-- Global Template -->
  <xsl:template match="*">
    <fo:block font-family="{$page.font}"
              font-size="{$page.size}">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>

  <!-- Section Content Template -->
  <xsl:template match="sectioncontent">
    <fo:block padding-bottom="{$section.space.content}">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                 Content Label Templates                 * -->
  <!-- *********************************************************** -->

  <!-- Title Template -->
  <xsl:template match="title">
    <fo:block font-size="{$title.size}"
              font-weight="{$title.weight}"
              padding-bottom="{$title.space}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Author Label Template -->
  <xsl:template match="authorslabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Reviewers Label Template -->
  <xsl:template match="reviewerslabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Section Label Template -->
  <xsl:template match="sectionlabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}"
              start-indent="-2pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Red Section Label Template -->
  <xsl:template match="sectionlabelred">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}"
              color="#FF0000"
              start-indent="-2pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Reference Label Template -->
  <xsl:template match="referenceslabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                  Global Inline Templates                * -->
  <!-- *********************************************************** -->

  <!-- Document Reference Template -->
  <xsl:template match="externaldocref">
    <fo:inline font-style="italic">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- External Document Template -->
  <xsl:template match="externaldocurl">
    <fo:inline text-decoration="underline">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- Subscript Template -->
  <xsl:template match="sub">
    <fo:inline baseline-shift="sub"
               font-size="8pt">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- Superscript Template -->
  <xsl:template match="sup">
    <fo:inline baseline-shift="sup"
               font-size="8pt">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- Italics Template -->
  <xsl:template match="italics">
    <fo:inline font-style="italic">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                  Author Listing Template                * -->
  <!-- *********************************************************** -->

  <!-- Main Author List Template -->
  <xsl:template match="authorslist">
    <fo:table-and-caption padding-bottom="{$authors.space.bottom}">
      <fo:table>
        <fo:table-column column-width="10pt"/>
        <fo:table-column column-width="6in"/>
        <fo:table-body>
          <xsl:for-each select="author">
            <fo:table-row>
              <fo:table-cell>
                <fo:block font-family="Webdings"
                          font-size="6pt"
                          padding-bottom="{$authors.space.item}">
                  <xsl:text>=</xsl:text>
                </fo:block>
              </fo:table-cell>
              <fo:table-cell>
                <fo:block padding-bottom="{$authors.space.item}">
                  <xsl:copy-of select="authorname/text()" />
                </fo:block>
              </fo:table-cell>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                Reviewers Listing Template               * -->
  <!-- *********************************************************** -->

  <!-- Main Reviewers List Template -->
  <xsl:template match="reviewerslist">
    <fo:table-and-caption padding-bottom="{$reviewers.space.bottom}">
      <fo:table border-width="{$reviewers.thick}" border-color="{$reviewers.color}">
        <fo:table-header>
          <fo:table-row>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Name</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Title</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Position</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Affiliation</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}">
                <xsl:text>Location</xsl:text>
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-header>
        <fo:table-body>
          <xsl:for-each select="reviewer">
            <fo:table-row>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewername/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewertitle/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewerposition/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="revieweraffiliation/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewerlocation/text()" />
                </fo:block>
              </fo:table-cell>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *        Generic Section Content Listing Template         * -->
  <!-- *********************************************************** -->

  <!-- Main List Template -->
  <xsl:template match="list1|list1red|list2|list2red|list3|list3red|list4|list4red|list5|list5red|list6|list6red|list7|list7red|list8|list8red">
    <fo:table-and-caption padding-top="{$list.space.top}">
      <fo:table>
      <fo:table-column column-width="15pt"/>
      <fo:table-column column-width="7in"/>
        <fo:table-body>
          <xsl:for-each select="node()">
            <xsl:choose>
              <xsl:when test="contains(name(), 'labelred')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                            	font-size="{$list.size.label}"
                            	font-weight="{$list.weight.label}"
                              padding-bottom="{$list.space.item}">
                      <xsl:copy-of select="text()" />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:when test="contains(name(), 'label')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#000000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#000000"
                            	font-size="{$list.size.label}"
                            	font-weight="{$list.weight.label}"
                              padding-bottom="{$list.space.item}">
                      <xsl:copy-of select="text()" />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:when test="contains(name(), 'itemred')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                            	font-size="{$list.size.item}"
                            	font-weight="{$list.weight.item}"
                              padding-bottom="{$list.space.item}">
                      <xsl:apply-templates />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:when test="contains(name(), 'item')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#000000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#000000"
                            	font-size="{$list.size.item}"
                            	font-weight="{$list.weight.item}"
                              padding-bottom="{$list.space.item}">
                      <xsl:apply-templates />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:otherwise>
                <!--
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#0000FF"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>r</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#0000FF"
                            	font-size="{$list.size.item}"
                            	font-weight="{$list.weight.item}"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>Unhandled.</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
                -->
                <xsl:apply-templates />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *               References Listing Templates              * -->
  <!-- *********************************************************** -->

  <!-- Main References List Template -->
  <xsl:template match="referenceslist">
    <fo:table-and-caption padding-bottom="{$references.space.bottom}">
      <fo:table>
        <fo:table-column column-width="10pt"/>
        <fo:table-column column-width="6.5in"/>
        <fo:table-body>
          <xsl:for-each select="reference">
            <fo:table-row>
              <fo:table-cell>
                <fo:block font-family="Webdings"
                          font-size="6pt"
                          padding-bottom="{$references.space.item}">
                  <xsl:text>=</xsl:text>
                </fo:block>
              </fo:table-cell>
              <fo:table-cell>
                <fo:block padding-bottom="{$references.space.item}">
                  <xsl:copy-of select="text()" />
                </fo:block>
              </fo:table-cell>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *              Miscellaneous Block Templates              * -->
  <!-- *********************************************************** -->

  <!-- Accession Number Template -->
  <xsl:template match="accession" padding-top="10pt">
    <fo:table-and-caption>
      <fo:table>
        <fo:table-column column-width="60pt"/>
        <fo:table-column column-width="6in"/>
        <fo:table-body>
          <fo:table-row>
            <fo:table-cell>
              <fo:block font-weight="bold">
                <xsl:text>Accession #:</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block>
                <xsl:copy-of select="text()" />
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- Date Template -->
  <xsl:template match="date">
    <fo:table-and-caption padding-top="10pt">
      <fo:table>
        <fo:table-column column-width="60pt"/>
        <fo:table-column column-width="6in"/>
        <fo:table-body>
          <fo:table-row>
            <fo:table-cell>
              <fo:block font-weight="bold">
                <xsl:text>Date:</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block>
                <xsl:copy-of select="text()" />
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

</xsl:stylesheet>

---------------------------------------
TINSTAAFL, which is why I contribute.
 
Tech Tips chopped the data for the stylesheet I think:
Code:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL]
                xmlns:fo="[URL unfurl="true"]http://www.w3.org/1999/XSL/Format"[/URL]
                xmlns:xse="[URL unfurl="true"]http://www.syntext.com/Extensions/XSLT-1.0"[/URL]
                xmlns:se="[URL unfurl="true"]http://syntext.com/XSL/Format-1.0"[/URL]
                version='1.0'>

  <!--
  
  ====================================================================
  
                    Miscellaneous Layout Configuration
  
  ====================================================================
  
  -->
  <xsl:param name="list.item.spacing" select="'2pt'" />

  <!--
  
  ====================================================================
  
                          Page Configuration
  
  ====================================================================
  
  -->

  <!-- Ignore Blanks -->  
  <xsl:strip-space elements="*"/>
  
  <xsl:template match="/">
    <fo:root>
      <fo:layout-master-set>
        <fo:simple-page-master master-name="Letter"
                               margin="0.5in"
                               page-height="11in"
                               page-width="8.5in">
          <fo:region-body />
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="Letter">
        <fo:flow flow-name="xsl-region-body">
          <xsl:apply-templates />
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                            Global Template
  
  ====================================================================
  
  -->
  
  <xsl:template match="*">
    <fo:block font-size="10pt">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                           Titles and Labels
  
  ====================================================================
  
  -->
  
  <!-- Title Template -->
  <xsl:template match="title">
    <fo:block font-size="24pt"
              font-weight="bold"
              padding-bottom="10pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>
  
  <!-- Author Label Template -->
  <xsl:template match="authorslabel">
    <fo:block font-weight="bold"
              font-size="18pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>
  
  <!-- Reviewers Label Template -->
  <xsl:template match="reviewerslabel">
    <fo:block font-weight="bold"
              font-size="18pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>
  
  <!-- Section Label Template -->
  <xsl:template match="sectionlabel">
    <fo:block font-weight="bold"
              font-size="18pt"
              start-indent="-2pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>
  
  <!-- Red Section Label Template -->
  <xsl:template match="sectionlabelred">
    <fo:block font-weight="bold"
              font-size="18pt"
              color="#FF0000"
              start-indent="-2pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>
  
  <!-- Reference Label Template -->
  <xsl:template match="referenceslabel">
    <fo:block font-weight="bold"
              font-size="12pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                            Document Sections
  
  ====================================================================
  
  -->
  
  <!-- Section Content Template -->
  <xsl:template match="sectioncontent">
    <fo:block padding-bottom="10pt">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                                 Lists
  
  ====================================================================
  
  -->
  
  <!-- References Table Template -->
  <xsl:template match="referenceslist">
    <fo:table-and-caption>
      <fo:table>
      <fo:table-column column-width="5mm"/>
      <fo:table-column column-width="7in"/>
        <fo:table-body>
          <xsl:for-each select="./reference">
            <fo:table-row>
              <fo:table-cell>
                <fo:block font-family="Webdings"
                          font-size="6pt"
                          padding-bottom="{$list.item.spacing}">
                  <xsl:text>=</xsl:text>
                </fo:block>
              </fo:table-cell>
              <fo:table-cell>
                <fo:block padding-bottom="{$list.item.spacing}">
                  <xsl:apply-templates />
                </fo:block>
              </fo:table-cell>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                                Authors
  
  ====================================================================
  
  -->
  
  <!-- Author List Template -->
  <xsl:template match="authorslist">
    <fo:block padding-bottom="5pt"
              padding-top="5pt"
              start-indent="10pt">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>
  
  <!-- Author Template -->
  <xsl:template match="authorname">
    <fo:block>
      <fo:inline font-family="Webdings"
                 font-size="6pt"
                 padding-bottom="5pt"
                 padding-right="5pt">
       <xsl:text>=</xsl:text>
      </fo:inline>
      <fo:inline padding-bottom="5pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>

  <!--
  
  ====================================================================
  
                               Reviewers
  
  ====================================================================
  
  -->

  <!-- Reviewer List Template -->
  <xsl:template match="reviewer">
    <fo:block padding-bottom="5pt"
              padding-top="5pt"
              start-indent="10pt">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>
  
  <!-- Reviewer Name Template -->
  <xsl:template match="reviewername">
    <fo:block>
      <fo:inline font-weight="bold"
                 color="#0000FF">
        <xsl:text>Name: </xsl:text>
      </fo:inline>
      <fo:inline padding-left="4pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>
  
  <!-- Reviewer Title Template -->
  <xsl:template match="reviewertitle">
    <fo:block>
      <fo:inline font-weight="bold"
                 color="#0000FF">
        <xsl:text>Title: </xsl:text>
      </fo:inline>
      <fo:inline padding-left="4pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>
  
  <!-- Reviewer Position Template -->
  <xsl:template match="reviewerposition">
    <fo:block>
      <fo:inline font-weight="bold"
                 color="#0000FF">
        <xsl:text>Position: </xsl:text>
      </fo:inline>
      <fo:inline padding-left="4pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>
  
  <!-- Reviewer Affiliation Template -->
  <xsl:template match="revieweraffiliation">
    <fo:block>
      <fo:inline font-weight="bold"
                 color="#0000FF">
        <xsl:text>Affiliation: </xsl:text>
      </fo:inline>
      <fo:inline padding-left="4pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>
  
  <!-- Reviewer Location Template -->
  <xsl:template match="reviewerlocation">
    <fo:block>
      <fo:inline font-weight="bold"
                 color="#0000FF">
        <xsl:text>Location: </xsl:text>
      </fo:inline>
      <fo:inline padding-left="4pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                           Lists 1 Templates
  
  ====================================================================
  
  -->
  
  <!-- List 1 Table Template -->
  <xsl:template match="list1|list1red">
    <fo:table-and-caption padding-top="5pt">
      <fo:table>
      <fo:table-column column-width="5mm"/>
      <fo:table-column column-width="7in"/>
        <fo:table-body>
          <xsl:apply-templates />
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>
  
  <!-- List 1 Row Template: Label -->
  <xsl:template match="list1label">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-family="Webdings"
                  font-size="10.5pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>4</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block font-size="12pt"
                  font-weight="bold"
                  padding-bottom="{$list.item.spacing}">
          <xsl:copy-of select="text()" />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!-- List 1 Row Template: Label Red -->
  <xsl:template match="list1labelred">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-family="Webdings"
                  font-size="10.5pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>4</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block color="#FF0000"
                  font-size="12pt"
                  font-weight="bold"
                  padding-bottom="{$list.item.spacing}">
          <xsl:copy-of select="text()" />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!-- List 1 Row Template: Item -->
  <xsl:template match="list1item">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-family="Webdings"
                  font-size="10.5pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>4</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block padding-bottom="{$list.item.spacing}">
          <xsl:apply-templates />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!-- List 1 Row Template: Item Red -->
  <xsl:template match="list1itemred">
    <fo:table-row>
      <fo:table-cell>
        <fo:block color="#FF0000"
                  font-family="Webdings"
                  font-size="10.5pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>4</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block color="#FF0000"
                  padding-bottom="{$list.item.spacing}">
          <xsl:apply-templates />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                           Lists 2 Templates
  
  ====================================================================
  
  -->
  
  <!-- List 2 Table Template -->
  <xsl:template match="list2|list2red">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-family="Webdings"
                  font-size="10.5pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text></xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:table-and-caption>
          <fo:table>
          <fo:table-column column-width="5mm"/>
          <fo:table-column column-width="7in"/>
            <fo:table-body>
              <xsl:apply-templates />
            </fo:table-body>
          </fo:table>
        </fo:table-and-caption>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!-- List 2 Row Template: Label -->
  <xsl:template match="list2label">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-family="Webdings"
                  font-size="6pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>=</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block font-size="12pt"
                  font-weight="bold"
                  padding-bottom="{$list.item.spacing}">
          <xsl:copy-of select="text()" />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!-- List 2 Row Template: Label Red -->
  <xsl:template match="list2labelred">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-family="Webdings"
                  font-size="6pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>=</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block color="#FF0000"
                  font-size="12pt"
                  font-weight="bold"
                  padding-bottom="{$list.item.spacing}">
          <xsl:copy-of select="text()" />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!-- List 2 Row Template: Item -->
  <xsl:template match="list2item">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-family="Webdings"
                  font-size="6pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>=</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block padding-bottom="{$list.item.spacing}">
          <xsl:apply-templates />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!-- List 2 Row Template: Item Red -->
  <xsl:template match="list2itemred">
    <fo:table-row>
      <fo:table-cell>
        <fo:block color="#FF0000"
                  font-family="Webdings"
                  font-size="6pt"
                  padding-bottom="{$list.item.spacing}">
          <xsl:text>=</xsl:text>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block color="#FF0000"
                  padding-bottom="{$list.item.spacing}">
          <xsl:apply-templates />
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                          Global Inline Elements
  
  ====================================================================
  
  -->
  
  <!-- Document Reference Template -->
  <xsl:template match="externaldocref">
    <fo:inline font-style="italic">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>
  
  <!-- External Document Template -->
  <xsl:template match="externaldocurl">
    <fo:inline text-decoration="underline">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>
  
  <!-- Subscript Template -->
  <xsl:template match="sub">
    <fo:inline baseline-shift="sub"
               font-size="8pt">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>
  
  <!-- Superscript Template -->
  <xsl:template match="sup">
    <fo:inline baseline-shift="sup"
               font-size="8pt">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>
  
  <!-- Italics Template -->
  <xsl:template match="italics">
    <fo:inline font-style="italic">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>
  
  <!--
  
  ====================================================================
  
                          Document Information
  
  ====================================================================
  
  -->
  
  <!-- Date Template -->
  <xsl:template match="date">
    <fo:block>
      <fo:inline font-weight="bold">
        <xsl:text>Date: </xsl:text>
      </fo:inline>
      <fo:inline padding-left="4pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>
  
  <!-- Accession Number Template -->
  <xsl:template match="accession">
    <fo:block>
      <fo:inline font-weight="bold">
        <xsl:text>Accession #: </xsl:text>
      </fo:inline>
      <fo:inline padding-left="4pt">
        <xsl:copy-of select="text()"/>
      </fo:inline>
    </fo:block>
  </xsl:template>
  
</xsl:stylesheet>

---------------------------------------
TINSTAAFL, which is why I contribute.
 
Oh this is funny, I posted the wrong template:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL]
                xmlns:fo="[URL unfurl="true"]http://www.w3.org/1999/XSL/Format"[/URL]
                xmlns:xse="[URL unfurl="true"]http://www.syntext.com/Extensions/XSLT-1.0"[/URL]
                xmlns:se="[URL unfurl="true"]http://syntext.com/XSL/Format-1.0"[/URL]
                version='1.0'>

  <!-- *********************************************************** -->
  <!-- *                Global Page Configuration                * -->
  <!-- *********************************************************** -->

  <!-- General Control -->
  <xsl:param name="page.font"   select="'Arial'" />
  <xsl:param name="page.height" select="'11in'"  />
  <xsl:param name="page.margin" select="'0.5in'" />
  <xsl:param name="page.size"   select="'10pt'"  />
  <xsl:param name="page.width"  select="'8in'"   />

  <!-- Document Title Control -->
  <xsl:param name="title.size"   select="'24pt'" />
  <xsl:param name="title.weight" select="'bold'" />
  <xsl:param name="title.space"  select="'10pt'" />

  <!-- Miscellaneous Title Control -->
  <xsl:param name="misc.size"   select="'16pt'" />
  <xsl:param name="misc.weight" select="'bold'" />
  <xsl:param name="misc.space"  select="'0pt'"  />

  <!-- List Control -->
  <xsl:param name="list.size.label"   select="'12pt'"   />
  <xsl:param name="list.size.item"    select="'10pt'"   />
  <xsl:param name="list.space.top"    select="'5pt'"    />
  <xsl:param name="list.space.item"   select="'2pt'"    />
  <xsl:param name="list.weight.label" select="'bold'"   />
  <xsl:param name="list.weight.item"  select="'normal'" />

  <!-- Authors Listing Control -->
  <xsl:param name="authors.space.bottom" select="'5pt'" />
  <xsl:param name="authors.space.item"   select="'5pt'" />

  <!-- Reviewers Listing Control -->
  <xsl:param name="reviewers.color"          select="'#CCCCCC'" />
  <xsl:param name="reviewers.pad.horizontal" select="'2pt'"     />
  <xsl:param name="reviewers.pad.vertical"   select="'2pt'"     />
  <xsl:param name="reviewers.space.bottom"   select="'5pt'"     />
  <xsl:param name="reviewers.thick"          select="'1pt'"     />

  <!-- References Listing Control -->
  <xsl:param name="references.space.bottom" select="'5pt'" />
  <xsl:param name="references.space.item"   select="'0pt'" />

  <!-- Section Control -->
  <xsl:param name="section.size.label"    select="'24pt'" />
  <xsl:param name="section.space.bottom"  select="'10pt'" />
  <xsl:param name="section.space.content" select="'10pt'" />
  <xsl:param name="section.space.label"   select="'10pt'" />
  <xsl:param name="section.weight.label"  select="'bold'" />

  <!-- *********************************************************** -->
  <!-- *                   Page Configuration                    * -->
  <!-- *********************************************************** -->

  <!-- Ignore Blanks -->  
  <xsl:strip-space elements="*"/>

  <!-- Layout Master -->
  <xsl:template match="/">
    <fo:root>
      <fo:layout-master-set>
        <fo:simple-page-master master-name="Letter"
                               margin="{$page.margin}"
                               page-height="{$page.height}"
                               page-width="{$page.width}">
          <fo:region-body />
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="Letter">
        <fo:flow flow-name="xsl-region-body">
          <xsl:apply-templates />
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                  Global Effect Template                 * -->
  <!-- *********************************************************** -->

  <!-- Global Template -->
  <xsl:template match="*">
    <fo:block font-family="{$page.font}"
              font-size="{$page.size}">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>

  <!-- Section Content Template -->
  <xsl:template match="sectioncontent">
    <fo:block padding-bottom="{$section.space.content}">
      <xsl:apply-templates />
    </fo:block>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                 Content Label Templates                 * -->
  <!-- *********************************************************** -->

  <!-- Title Template -->
  <xsl:template match="title">
    <fo:block font-size="{$title.size}"
              font-weight="{$title.weight}"
              padding-bottom="{$title.space}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Author Label Template -->
  <xsl:template match="authorslabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Reviewers Label Template -->
  <xsl:template match="reviewerslabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Section Label Template -->
  <xsl:template match="sectionlabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}"
              start-indent="-2pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Red Section Label Template -->
  <xsl:template match="sectionlabelred">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}"
              color="#FF0000"
              start-indent="-2pt">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- Reference Label Template -->
  <xsl:template match="referenceslabel">
    <fo:block font-weight="{$misc.weight}"
              font-size="{$misc.size}">
      <xsl:copy-of select="text()"/>
    </fo:block>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                  Global Inline Templates                * -->
  <!-- *********************************************************** -->

  <!-- Document Reference Template -->
  <xsl:template match="externaldocref">
    <fo:inline font-style="italic">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- External Document Template -->
  <xsl:template match="externaldocurl">
    <fo:inline text-decoration="underline">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- Subscript Template -->
  <xsl:template match="sub">
    <fo:inline baseline-shift="sub"
               font-size="8pt">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- Superscript Template -->
  <xsl:template match="sup">
    <fo:inline baseline-shift="sup"
               font-size="8pt">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- Italics Template -->
  <xsl:template match="italics">
    <fo:inline font-style="italic">
      <xsl:copy-of select="text()"/>
    </fo:inline>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                  Author Listing Template                * -->
  <!-- *********************************************************** -->

  <!-- Main Author List Template -->
  <xsl:template match="authorslist">
    <fo:table-and-caption padding-bottom="{$authors.space.bottom}">
      <fo:table>
        <fo:table-column column-width="10pt"/>
        <fo:table-column column-width="6in"/>
        <fo:table-body>
          <xsl:for-each select="author">
            <fo:table-row>
              <fo:table-cell>
                <fo:block font-family="Webdings"
                          font-size="6pt"
                          padding-bottom="{$authors.space.item}">
                  <xsl:text>=</xsl:text>
                </fo:block>
              </fo:table-cell>
              <fo:table-cell>
                <fo:block padding-bottom="{$authors.space.item}">
                  <xsl:copy-of select="authorname/text()" />
                </fo:block>
              </fo:table-cell>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *                Reviewers Listing Template               * -->
  <!-- *********************************************************** -->

  <!-- Main Reviewers List Template -->
  <xsl:template match="reviewerslist">
    <fo:table-and-caption padding-bottom="{$reviewers.space.bottom}">
      <fo:table border-width="{$reviewers.thick}" border-color="{$reviewers.color}">
        <fo:table-header>
          <fo:table-row>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Name</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Title</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Position</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}"
                        border-right-width="{$reviewers.thick}"
                        border-right-color="{$reviewers.color}">
                <xsl:text>Affiliation</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block font-weight="bold"
                        border-bottom-width="{$reviewers.thick}"
                        border-bottom-color="{$reviewers.color}">
                <xsl:text>Location</xsl:text>
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-header>
        <fo:table-body>
          <xsl:for-each select="reviewer">
            <fo:table-row>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewername/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewertitle/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewerposition/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             border-right-width="{$reviewers.thick}"
                             border-right-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="revieweraffiliation/text()" />
                </fo:block>
              </fo:table-cell>
              <fo:table-cell border-bottom-width="{$reviewers.thick}"
                             border-bottom-color="{$reviewers.color}"
                             padding-bottom="{$reviewers.pad.vertical}"
                             padding-left="{$reviewers.pad.horizontal}"
                             padding-right="{$reviewers.pad.horizontal}"
                             padding-top="{$reviewers.pad.vertical}">
                <fo:block>
                  <xsl:copy-of select="reviewerlocation/text()" />
                </fo:block>
              </fo:table-cell>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *        Generic Section Content Listing Template         * -->
  <!-- *********************************************************** -->

  <!-- Main List Template -->
  <xsl:template match="list1|list1red|list2|list2red|list3|list3red|list4|list4red|list5|list5red|list6|list6red|list7|list7red|list8|list8red">
    <fo:table-and-caption padding-top="{$list.space.top}">
      <fo:table>
      <fo:table-column column-width="15pt"/>
      <fo:table-column column-width="7in"/>
        <fo:table-body>
          <xsl:for-each select="node()">
            <xsl:choose>
              <xsl:when test="contains(name(), 'labelred')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                            	font-size="{$list.size.label}"
                            	font-weight="{$list.weight.label}"
                              padding-bottom="{$list.space.item}">
                      <xsl:copy-of select="text()" />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:when test="contains(name(), 'label')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#000000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#000000"
                            	font-size="{$list.size.label}"
                            	font-weight="{$list.weight.label}"
                              padding-bottom="{$list.space.item}">
                      <xsl:copy-of select="text()" />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:when test="contains(name(), 'itemred')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#FF0000"
                            	font-size="{$list.size.item}"
                            	font-weight="{$list.weight.item}"
                              padding-bottom="{$list.space.item}">
                      <xsl:apply-templates />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:when test="contains(name(), 'item')">
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#000000"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>4</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#000000"
                            	font-size="{$list.size.item}"
                            	font-weight="{$list.weight.item}"
                              padding-bottom="{$list.space.item}">
                      <xsl:apply-templates />
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </xsl:when>
              <xsl:otherwise>
                <!--
                <fo:table-row>
                  <fo:table-cell>
                    <fo:block color="#0000FF"
                              font-family="Webdings"
                              font-size="10.5pt"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>r</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                  <fo:table-cell>
                    <fo:block color="#0000FF"
                            	font-size="{$list.size.item}"
                            	font-weight="{$list.weight.item}"
                              padding-bottom="{$list.space.item}">
                      <xsl:text>Unhandled.</xsl:text>
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
                -->
                <xsl:apply-templates />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *               References Listing Templates              * -->
  <!-- *********************************************************** -->

  <!-- Main References List Template -->
  <xsl:template match="referenceslist">
    <fo:table-and-caption padding-bottom="{$references.space.bottom}">
      <fo:table>
        <fo:table-column column-width="10pt"/>
        <fo:table-column column-width="6.5in"/>
        <fo:table-body>
          <xsl:for-each select="reference">
            <fo:table-row>
              <fo:table-cell>
                <fo:block font-family="Webdings"
                          font-size="6pt"
                          padding-bottom="{$references.space.item}">
                  <xsl:text>=</xsl:text>
                </fo:block>
              </fo:table-cell>
              <fo:table-cell>
                <fo:block padding-bottom="{$references.space.item}">
                  <xsl:copy-of select="text()" />
                </fo:block>
              </fo:table-cell>
            </fo:table-row>
          </xsl:for-each>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- *********************************************************** -->
  <!-- *              Miscellaneous Block Templates              * -->
  <!-- *********************************************************** -->

  <!-- Accession Number Template -->
  <xsl:template match="accession" padding-top="10pt">
    <fo:table-and-caption>
      <fo:table>
        <fo:table-column column-width="60pt"/>
        <fo:table-column column-width="6in"/>
        <fo:table-body>
          <fo:table-row>
            <fo:table-cell>
              <fo:block font-weight="bold">
                <xsl:text>Accession #:</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block>
                <xsl:copy-of select="text()" />
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

  <!-- Date Template -->
  <xsl:template match="date">
    <fo:table-and-caption padding-top="10pt">
      <fo:table>
        <fo:table-column column-width="60pt"/>
        <fo:table-column column-width="6in"/>
        <fo:table-body>
          <fo:table-row>
            <fo:table-cell>
              <fo:block font-weight="bold">
                <xsl:text>Date:</xsl:text>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell>
              <fo:block>
                <xsl:copy-of select="text()" />
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-body>
      </fo:table>
    </fo:table-and-caption>
  </xsl:template>

</xsl:stylesheet>

---------------------------------------
TINSTAAFL, which is why I contribute.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top