Click to See Complete Forum and Search --> : Need a Help


technomatters
06-16-2009, 09:54 AM
Dear All,

I need to show some data from xml to html page in a table with an image

This table have several records as follows

each record contains the following fields

1. country

2. contact number

3. doctor name with his photo and a more info link

4. specialty ( a single word text only)


there will be 5 rows for each page.

I tried a lot to get the info from the web, but i can't.

we are working for AIDS control Society of India.

Kindly help us.

Regards
venkat

jkmyoung
06-19-2009, 03:26 PM
http://www.w3schools.com/Xsl/default.asp

Do you have control of the xml generation?

technomatters
06-20-2009, 03:11 AM
Hi,

Thanks for your support.

we create xml manually. I tried the example you have given in the url.

But it is not showing any image example.

Can you help me please.

Regards
venkat

jkmyoung
06-22-2009, 10:28 AM
HTML tutorial, specifically image tag:
http://www.w3schools.com/tags/tag_IMG.asp

So if using xslt, code is usually something like:


guessing, if your source like:
<row>
...
<doctor>
<name>Dr. Hugh Jazz</name>
<photo>kagja.jpg</photo>
<moreinfo>http://www.docsci.com/profile/drhughjazz.html</profile>
</doctor>
...
</row>

then xsl would be like:
<xsl:for-each select="row">
...
<img src="{doctor/photo}"/>
<a href="{doctor/photo}">More info on <xsl:value-of select="doctor/name"/></a>
...
</xsl:for-each>


Note use of braces {} if evaluating an xpath inside an attribute.