Oxygen XML Editor
 
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XSL formatting


Subject: Re: [xsl] XSL formatting
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Fri, 23 Dec 2005 11:44:55 +0200

Hi,

Adding an additional for-each that will iterate on the img elements from the redundant element that do not have a corresponding img in missing should do it:

<xsl:transform 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>
<xsl:variable name="mc" select="count(missing/img)"/>
<xsl:for-each select="redundant/img[position()>$mc]">
<tr>
<td/>
<td>
<xsl:value-of select="@name"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:transform>


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


Shailesh Shinde wrote:
Hi,

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

Thanks,
Shailesh


Current Thread
 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor
Keywords