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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables/Parameters, should be simple

Status
Not open for further replies.

jmeckley

Programmer
Joined
Jul 15, 2002
Messages
5,269
Location
US
Being brand new to XML and XSLT I am having a difficult understanding how variables and parameters work. I read this article and was profoundly confused.


I have an xml file generated by my database with the following format
Code:
<Report>
  <SalesPerson>
    <Name>name of sales person</Name>
    <Month>month for sales</July>
    <Sales>
      <Business>New or Renewal</Business>
      <Company>name of company</Company>
      <Amount>amount of sale</Amount>
    </Sales>
    ...
  </SalesPerson>
 ...
</Report>

I am using XSLT to for the data for a web report. The report will beformatted as follows:
Code:
Name of Sales Person/Month of Sales

New Business
Company    Amount
...
           Total of New Business

Renewal Business
Company   Amount
...
          Total of Renewal Business

          Total for Sales Person (New and Renew)
          Gand Total for all Sales Persons

I was able to generate this in one entire template, but wanted to use mulitple templates for re-usability. How can I build a template to filter my sales by business so I don't have to code 2 for-each/if statements in 1 giant template (current setup)?

Jason Meckley
Database Analyst
WITF
 
can you supply a full example xml and xslt you are currently using.

i will modify it to use multiple templates.

-jay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top