Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Open Points: 250 Time: 23:41 - Aug 10, 2009  

anujojha1

Need help to display the images in row and column format.

Hi I have this xml file from which i need to display the images in table format using xslt. like if there are 4 pictures then I need to display the 1st picture in the 1st row 1st column, 2nd in 1st row 2nd column, 3rd in 2nd row 1st column and so on... can you please help me to do it??? till now this is what i could do...

-------------------------XSL---------------------------------------------


<?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="assrec.xml" --><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
<!ENTITY copy "&#169;">
<!ENTITY reg "&#174;">
<!ENTITY trade "&#8482;">
<!ENTITY mdash "&#8212;">
<!ENTITY ldquo "&#8220;">
<!ENTITY rdquo "&#8221;">
<!ENTITY pound "&#163;">
<!ENTITY yen "&#165;">
<!ENTITY euro "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform&......
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-t...
<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>

Categories

Answer Discussion
Tutorials

 

This question has not yet been answered.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Tutorials cannot be submitted until the Answer Discussion is complete.

Submit answers in the Answer Discussion area

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es