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

RE: XSL formatting

Subject: RE: XSL formatting
From: "Shailesh Shinde" <shailesh@xxxxxxxxxxxx>
Date: Fri, 23 Dec 2005 15:02:28 +0530
bina remax
Hi,

Same number of images are not there in both missing and redundant.

Thanks,
Shailesh
-----Original Message-----
From: George Cristian Bina [mailto:george@xxxxxxxxxxxxx] 
Sent: Friday, December 23, 2005 2:38 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  XSL formatting

Hi Shailesh,

If you have the same number of img elements in both missing and 
redundant then something like below should work. Otherwise you need a 
little more logic.

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template match="/imgBook">
         <html>
             <head>
                 <title>Sample</title>
             </head>
             <body>
                 <table border="1">
                     <tr>
                         <td>missing</td>
                         <td>redundant</td>
                     </tr>
                     <xsl:for-each select="missing/img">
                         <xsl:variable name="pos" select="position()"/>
                         <tr>
                             <td>
                                 <xsl:value-of select="@name"/>
                             </td>
                             <td>
                                 <xsl:value-of 
select="../../redundant/img[$pos]/@name"/>
                             </td>
                         </tr>
                     </xsl:for-each>
                 </table>
             </body>
         </html>
     </xsl:template>
</xsl:stylesheet>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Shailesh Shinde wrote:
> Hi All
> I have an Input xml as:
> 
> <imgBook node="">
> <missing>
> <img name = "path_trace3%20wo%20text.png"/>
> <img name = "dm_arrow_right.png"/>
> <img name = "dm_arrow_corner.png"/>
>  </missing>
> <redundant>
> <img name = "40LinkedDoc.png"/>
> <img name = "artList_xlinkedpngs.xls"/>
> <img name = "Dublin_two_dwg.png"/>
> </redundant>
> 
> I have to display html view of this as in table where heading is missing
and
> redundant
> Under that @name for respective headings.
> 
> Thanks,
> Shailesh

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.