Jump to content
Sign in to follow this  
cauca1991

how to display url of picture store in xml

Recommended Posts

i hove store url of pic in xml i wan to get them and display in html i have been use Xpath language and XSLT but i don't display this pic.

who can help me? thanks for help full :)

follow is content of file xml(name hanghoa.xml) and file xslt(name hanghoa.xslt)

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xml" href="hanghoa.xslt"?>
<KimLan>
<HangHoa>
<TenHang>Thuoc la Thang Long</TenHang>
<HinhAnh><img src="pics/thuoclathanglong.jpg"/></HinhAnh>(i try to replace that)<HinhAnh>"pics/thuoclathanglong.jpg"</HinhAnh>
<Gia>8.000 VND</Gia>
<GhiChu>Một cây: 100.000 VND</GhiChu>
</HangHoa>
</KimLan>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>Tap Hoa Kim Lan</title>
<link href="css/common.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="header"></div>
<div class="content">
<xsl:for-each select="/KimLan/HangHoa">
<xsl:variable name="url" select="HinhAnh"/>
<div class="hanghoa">
<xsl:value-of select="$url"/> ( i try to replace that with)<img src="<xsl:value-of select="$url"/>"/>
<div class="detail">
<p><xsl:value-of select="TenHang"/></p>
<p><xsl:value-of select="Gia"/></p>
<p><xsl:value-of select="GhiChu"/></p>
</div>
</div>
</xsl:for-each>
<div class="clr"></div>
</div>
<div class="footer">
<p>
Website is create by Nguyen Van Tuyen
</p>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...