Placing Pictures From Xml File In Table In Row Wise Fashion.
hi guys I have created something in xslt. but my problem is same pic is selected in different column of the row.
what i want is a row with 2 columns which has the images which are there in xml document and after the 2nd column the third image should be in second row 1st column and so on..... here is what i have created... plzzzz someone help me do this.....
-------------------------XSL---------------------------------------------
<?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="assrec.xml" --><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "â¢">
<!ENTITY mdash "â">
<!ENTITY ldquo "â">
<!ENTITY rdquo "â">
<!ENTITY pound "£">
<!ENTITY yen "Â¥">
<!ENTITY euro "â¬">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Untitled Document</title>
</head>
<body>
<table cellspacing="0px" cellpadding="1px" style="width:192px; border:0px; color:#999999;">
<tr>
<th align='center' colspan="2" style=" background-image:url(images/menutop.gif); background-repeat:repeat; height:30px; color: #CCCCCC; font:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;">Employee</th>
</tr>
<xsl:for-each select="ListItems/ListItem">
<tr style="background-image: url(images/menumiddle.gif); background-repeat:repeat; width:192px; height:80px;">
<td ><img src="{image/@href}" width="75" height="70" align="right" style="border: solid; border-color:#999999; border-width:2px; "/><br /> <xsl:value-of select="name"/></td>
<td>
<img src="{image/@href}" width="75" height="70" align="right" style="border: solid; border-color:#999999; border-width:2px; "/>
<br /> <xsl:value-of select="name"/></td>
</tr>
</xsl:for-each>
<tr>
<td colspan="2" style=" background-image:url(images/menubottom.gif); color:#000000">.
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
------------------------------------------------------XML------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<?xml:stylesheet type="text/xsl" href="assrec.xsl"?>
<ListItems>
<ListItem>
<image href="C:\wampserver 2\www\aafes test\my\by vickey\cdtest\images\member1.jpg">
</image>
<name>anuj</name>
</ListItem>
<ListItem>
<image href="C:\wampserver 2\www\aafes test\my\by vickey\cdtest\images\member2.jpg">
</image>
<name>bb</name>
</ListItem>
<ListItem>
<image href="C:\wampserver 2\www\aafes test\my\by vickey\cdtest\images\member3.jpg">
</image>
<name>anuj</name>
</ListItem>
<ListItem>
<image href="C:\wampserver 2\www\aafes test\my\by vickey\cdtest\images\member4.jpg">
</image>
<name>bb</name>
</ListItem>
</ListItems>
right now I am getting the out as
1 1
2 2
3 3
but I want it to b like..
1 2
3 4
5 6
or even this sound good
1 6
2 7
3 8
4 9
5 10
and so on.........
|