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

find the correct rows to apply appropriate templates

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

  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] =
'SupplierOrganizationCode']"/>
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] =
'SupplierOrganizationCode']/@id"/>
  Any better idea how this could be handled?

Much thanks,
Xiaocun

Attached Sample XML:
  <row>
    <cell column="1">*PerformanceFactorCode</cell>
    <cell column="2">*PerformanceFactorName</cell>
    <cell
column="3">*PerformanceFactorDefaultRating</cell>
    <cell
column="4">PerformanceFactorDescription</cell>
  </row>
  <row>
    <cell column="1">pf1</cell>
    <cell column="2">pf1</cell>
    <cell column="3">10</cell>
  </row>
  <row>
    <cell column="1">pf2</cell>
    <cell column="2">pf2</cell>
    <cell column="3">20</cell>
  </row>
  <row>
    <cell column="1">pf3</cell>
    <cell column="2">pf3</cell>
    <cell column="3">30</cell>
  </row>
  <row>
    <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>
  </row>
  <row>
    <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>
  </row>
  <row>
    <cell column="1">EmailAddress</cell>
    <cell column="2">FaxNumber</cell>
    <cell column="3">WorkPhoneNumber</cell>
    <cell column="4">AlternatePhoneNumber</cell>
  </row>
  <row>
    <cell column="1">test@xxxxxxxx</cell>
    <cell column="2">(800) 555-1212</cell>
    <cell column="3">(800) 555-1212</cell>
  </row>


__________________________________________________
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

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.