This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: retrive data from #1 xml via data from #2 xml


I have a piece of XSLT that I think gets close to a solution (thanks again
Jeni), but it seems that it does not return any data.

<tr>
   <xsl:for-each select="$data">
      <xsl:variable name="datum" select="." />
      <xsl:for-each select="$columns">
         <xsl:variable name="column" select="." />
         <td>
            <xsl:value-of select="$datum/*[name() = $column]" />
         </td>
      </xsl:for-each>
   </xsl:for-each>
</tr>

[my sample data has 3 records]

This creates a table with 3 rows, 12 columns, but no data.

It should be 3 rows 5 columns with data.

I have attached my display data xml and the sample data.

Can someone let me know what I am doing wrong?

Walter

=====================
Display data
=====================
<titles>
 <display id='source/timestamp'  colWidth='104' sortOrder='D'
defaultSort='T'>Date</display>
 <display id='curr_dest'         colWidth='060' sortOrder='A'
defaultSort='F'>Agent</display>
 <display id='media'             colWidth='060' sortOrder='A'
defaultSort='F'>Channel</display>
 <display id='reason'            colWidth='120' sortOrder='A'
defaultSort='F'>Reason</display>
 <display id='detailed_comment'  colWidth='*'   sortOrder='A'
defaultSort='F'>Comments</display>
</titles>
=====================
Sample Data
=====================
<callEvent>
   <response>
      <interaction_list>
         <interaction id='19766'>
            <source>
               <timestamp
julian='00979661061000'>2001-01-16T10:14:21</timestamp>
               <media_type id='103'>Phone</media_type>
               <channel id='1'>&lt;unspecified&gt;</channel>
               <ani></ani>
               <dnis></dnis>
               <route_type>I</route_type>
            </source>
            <events>
               <call_event id='34757'>
                  <timestamp
julian='979661080000'>2001-01-16T10:14:40</timestamp>
                  <call_event_type id='28'>eMail</call_event_type>
                  <customer id='2124'>Harris</customer>
                  <curr_dest id='103'>Vincent</curr_dest >
                  <to_dest id='1'>&lt;unspecified&gt;</to_dest>
                  <nav_code id='1'></nav_code>
                  <rule id='1'></rule>
                  <greeting id='1'></greeting>
                  <call_type id='1'></call_type>
                  <ext_call id='1'></ext_call>
                  <old_call_record id='1'></old_call_record>
                  <product id='1'></product>
                  <reason id='198'>Case Resolution</reason>
                  <detailed_comment>test</detailed_comment>
               </call_event>
            </events>
         </interaction>
         <interaction id='19767'>
            <source>
               <timestamp
julian='00979661088000'>9999-01-16T10:04:48</timestamp>
               <media_type id='103'>inquiry</media_type>
               <channel id='1'>&lt;unspecified&gt;</channel>
               <ani></ani>
               <dnis></dnis>
               <route_type>I</route_type>
            </source>
            <events>
               <call_event id='34759'>
                  <timestamp
julian='979661539000'>2001-01-16T10:12:19</timestamp>
                  <call_event_type id='27'>phone</call_event_type>
                  <customer id='2124'>Harris</customer>
                  <curr_dest id='103'>Vincent</curr_dest >
                  <to_dest id='1'>&lt;unspecified&gt;</to_dest>
                  <nav_code id='1'></nav_code>
                  <rule id='1'></rule>
                  <greeting id='1'></greeting>
                  <call_type id='1'></call_type>
                  <ext_call id='1'></ext_call>
                  <old_call_record id='1'></old_call_record>
                  <product id='1'></product>
                  <reason id='98'>Case Resolution</reason>
                  <detailed_comment>testing 10:10 AM</detailed_comment>
               </call_event>
            </events>
         </interaction>
         <interaction id='19768'>
            <source>
               <timestamp
julian='00979662616000'>2001-01-16T10:30:16</timestamp>
               <media_type id='103'>inquiry</media_type>
               <channel id='1'>&lt;unspecified&gt;</channel>
               <ani></ani>
               <dnis></dnis>
               <route_type>I</route_type>
            </source>
            <events>
               <call_event id='34768'>
                  <timestamp
julian='979662663000'>2001-01-16T10:31:03</timestamp>
                  <call_event_type id='28'>eMail</call_event_type>
                  <customer id='2124'>Harris</customer>
                  <curr_dest id='103'>Vincent</curr_dest >
                  <to_dest id='1'>&lt;unspecified&gt;</to_dest>
                  <nav_code id='1'></nav_code>
                  <rule id='1'></rule>
                  <greeting id='1'></greeting>
                  <call_type id='1'></call_type>
                  <ext_call id='1'></ext_call>
                  <old_call_record id='1'></old_call_record>
                  <product id='1'></product>
                  <reason id='98'>Case Resolution</reason>
                  <detailed_comment>test  1-16-00  10:30
am</detailed_comment>
               </call_event>
            </events>
         </interaction>
      </interaction_list>

      <event_count>317</event_count>

      <stats>
         <time_for_query>580-milliseconds</time_for_query>
         <result_set_time>1-second 723-milliseconds</result_set_time>
         <total_time>2-seconds 374-milliseconds</total_time>
      </stats>

   </response>
</callEvent>

=====================


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]