[xsl] find the correct rows to apply appropriate templates

Subject: [xsl] find the correct rows to apply appropriate templates
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Mon, 4 Jun 2001 13:50:03 -0700 (PDT)

  I still have a problem trying to convert the generic
XML (generated from spreadsheet, attached at the end
of this message) to the specific XML I needed.
  The structure of the generic XML has 4 sections,
each section is consisted of a header row and (1 or
more) detail rows.  For each of those sections, I need
to apply a different template.
  The problem, how to find the starting and ending row
of each of the sections, and therefore apply the
appropriate templates to those rows?
  Currently, I locate and save the header rows like:
<xsl:variable name="SupplierProfileHeader"
select="book/sheet/range/row[cell[1] =
How to locate and save the row number of this header? 
The only way I can think of is to add id attribute to
<row> element so to identify row number, then I can
extract the row number with:
<xsl:variable name="SupplierProfileHeaderRow"
select="book/sheet/range/row[cell[1] =
  Any better idea how this could be handled?

Much thanks,

Attached Sample XML:
    <cell column="1">*PerformanceFactorCode</cell>
    <cell column="2">*PerformanceFactorName</cell>
    <cell column="1">pf1</cell>
    <cell column="2">pf1</cell>
    <cell column="3">10</cell>
    <cell column="1">pf2</cell>
    <cell column="2">pf2</cell>
    <cell column="3">20</cell>
    <cell column="1">pf3</cell>
    <cell column="2">pf3</cell>
    <cell column="3">30</cell>
    <cell column="1">*SupplierOrganizationCode</cell>
    <cell column="2">SupplierName</cell>
    <cell column="3">SupplierProfileCode</cell>
    <cell column="4">SupplierContactName</cell>
    <cell column="5">Address1</cell>
    <cell column="6">Address2</cell>
    <cell column="7">City</cell>
    <cell column="8">State</cell>
    <cell column="9">ZipCode</cell>
    <cell column="10">CountryCode</cell>
    <cell column="1">s1</cell>
    <cell column="2">test name for s1</cell>
    <cell column="3">test_s1</cell>
    <cell column="4">Albert</cell>
    <cell column="5">5 Brown Street</cell>
    <cell column="7">Andover</cell>
    <cell column="8">MA</cell>
    <cell column="9">01810</cell>
    <cell column="10">US</cell>
    <cell column="1">EmailAddress</cell>
    <cell column="2">FaxNumber</cell>
    <cell column="3">WorkPhoneNumber</cell>
    <cell column="4">AlternatePhoneNumber</cell>
    <cell column="1">test@xxxxxxxx</cell>
    <cell column="2">(800) 555-1212</cell>
    <cell column="3">(800) 555-1212</cell>

Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread