Re: [xsl] Vertical Resulting Display...Format..

Subject: Re: [xsl] Vertical Resulting Display...Format..
From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Thu, 14 Mar 2002 04:23:23 -0000
Hi,

Im not too sure about your requirements, but the following will give you the
ouput you have stated

cheers
andrew

==xsl==
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
  <table>
    <th>Impl File</th>
    <th>Header File</th>
    <xsl:apply-templates select="Project/SubProject"/>
  </table>
</xsl:template>

<xsl:template match="SubProject">
  <tr>
    <td><xsl:value-of select="ImplFiles/File[1]"/></td>
    <td><xsl:value-of select="HeaderFiles/File[1]"/></td>
  </tr>
</xsl:template>
</xsl:stylesheet>

=========
>
>
> Hi All,
>    Here is a xml.
>
>    <?xml version='1.0'?>
> <Project>
> <SubProject ID="1">
> <ImplFiles>
> <TotalFiles>3</TotalFiles>
> <File>KTbizAgent.cpp</File>
> <File>KTCbizAgent.cpp</File>
> <File>StdAfx.cpp</File>
> </ImplFiles>
> <HeaderFiles>
> <TotalFiles>3</TotalFiles>
> <File>KTbizAgent.h</File>
> <File>resource.h</File>
> <File>StdAfx.h</File>
> </HeaderFiles>
> </SubProject>
> <SubProject ID="2">
> <ImplFiles>
> <TotalFiles>3</TotalFiles>
> <File>KTdbAgent.cpp</File>
> <File>KTCdbAgent.cpp</File>
> <File>StdAfx.cpp</File>
> </ImplFiles>
> <HeaderFiles>
> <TotalFiles>3</TotalFiles>
> <File>KTdbAgent.h</File>
> <File>resource.h</File>
> <File>StdAfx.h</File>
> </HeaderFiles>
> </SubProject>
> </Project>
>
>
>    I want the output to be
>
>        <Table>
>             <TH>Impl File</TH>
>             <TH>Header File</TH>
>              <TR>
>                   <TD>KTbizAgent.cpp</TD>
>                   <TD>KTbizAgent.h</TD>
>        </TR>
>              <TR>
>        <TD>KTdbAgent.cpp</TD>
>                   <TD>KTdbAgent.h</TD>
>              </TR>
>              ...
>               ....
>              ...
>          </TABLE>
>
>  I want Vertical result.As it is inital phase if i need to optimize my xml
> let me know .
>
> Thanks in Advance
> Sachi
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


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


Current Thread