View Single Post
  #1 (permalink)  
Old June 12th, 2004, 05:22 PM
gurbani gurbani is offline
Registered User
Join Date: Jun 2004
Location: Raheen, Limerick, Ireland.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple XML files matched with common Number Id


I'm new to XSLT and I'm strugling trying to get this done. I'd really appreciate any help.

I have multiple sources of XML. There is one file which contains the test definitions (test number, its name, and its unit). The other files contain experiments, etc. per each of these tests. I'm trying to develop an XSLT that transforms this into an HTML table (see below for a simplified example).

XML File 1: definitions.xml

- <test number="1">
     <Name>Test 1</Name>
- <test number="2">
  <Name>Test 2</Name>
  <Unit />
- <test number="4">
  <Name>Test Blah</Name>


XML File 2: experiments.xml
- <temperature value="25degC">
     <test number="1">
     <test number="3">
- <temperature value="50degC">
     <test number="1">
     <test number="2">

OUTPUT should be something like this, where tests numbers will be mathched. If it is missing in any side, it'll still be output, but either with the test name/unit missing, or with the experiment data missing>

<table border=1 cellpadding=0>
  <td rowspan=2>Test No</td>
  <td rowspan=2>Name</td>
  <td rowspan=2>Unit</td>
  <td colspan=2>25degC</td>
  <td colspan=2>50degC</td>
  <td>Mean</td> <td>Sigma</td> <td>Mean</td> <td>Sigma</td>
    <td>1</td> <td>Test 1</td> <td>Celcius</td> <td>0.23</td> <td>10.44</td> <td>1.22</td> <td>13.13</td>
    <td>2</td> <td>Test 2</td> <td></td> <td></td> <td></td> <td>0.16</td> <td>0.31</td>
    <td>3</td> <td></td> <td></td> <td>0.13</td> <td>11.33</td> <td></td> <td></td>
    <td>4</td> <td>Test Blah</td> <td>Km</td> <td></td> <td></td> <td></td> <td></td>

Thanks in advance for your help!

Kind regards,

Prem Gurbani
Software Engineer,WW Mfg
Analog Devices Inc.
Reply With Quote