Jump to content

How do I add href links to my images in XML?


yldziner

Recommended Posts

I need to add links to my XML but I do not know how to get there:<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="build.xsl" type="text/xsl"?><style> (intro_text> <header>Salvaged Cars - Ready To Rebuild</header> <body> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam volutpat ipsum non ante. In eget leo non lectus pulvinar lacinia. Morbi tincidunt tempus mi. Duis lacinia, tellus sit amet volutpat vulputate, est pede nonummy nisl, at porta augue orci vel tortor. Nulla facilisi. Proin blandit convallis enim. Nullam ligula turpis, venenatis a, gravida nec, lobortis ut, quam. Cras elit risus, pharetra sed, pellentesque vitae, dictum sit amet, turpis. Donec metus ligula, tempor vitae, accumsan vitae, rhoncus id, enim. Vivamus metus ipsum, imperdiet at, ullamcorper ut, dictum quis, lorem. Vestibulum lectus lorem, fringilla sed, aliquam id, mattis eu, augue. Maecenas lacinia nunc eu ligula viverra rhoncus. Sed ut erat. Integer accumsan. Nunc pharetra. Duis id erat eget tortor ullamcorper tristique. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </body> (/intro_text> <list_item id="1"> <imgsrc>images/sample.jpg</imgsrc> // I want to make a link here <year>2007</year> <make>BMW</make> <model>535i</model> <miles>85,000</miles> <price>$15,000</price> </list_item> <list_item id="2"> <imgsrc>images/sample.jpg</imgsrc> // I want to make a link here <year>2007</year> <make>Mercedes Benz</make> <model>300C</model> <miles>12,000</miles> <price>$11,000</price> </list_item> <list_item id="3"> <imgsrc>images/sample.jpg</imgsrc> // I want to make a link here <year>2001</year> <make>BMW</make> <model>M5</model> <miles>23,062</miles> <price>$25,000</price> </list_item> <list_item id="4"> <imgsrc>images/sample.jpg</imgsrc> // I want to make a link here <year>1997</year> <make>Toyota</make> <model>Corolla</model> <miles>5,418</miles> <price>$4,500</price> </list_item></style>

Link to comment
Share on other sites

Please explain your first statement again.

Link to comment
Share on other sites

I need to add links to my XML but I do not know how to get there:<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="build.xsl" type="text/xsl"?>... <imgsrc>images/sample.jpg</imgsrc> // I want to make a link here...
Well, the referenced stylesheet build.xsl presumably already uses your imgsrc element to emit an <img> html element. So it appears you need to add xml for the other image attributes required, such as:
<imgsrc>images/sample.jpg</imgsrc> <imghref>your href for the image</imghref><imgtitle>your title for the image</imgtitle><imgalt>your alt text for the image</imgalt>

and update build.xsl to use these too.Post build.xsl if that's not clear and you'd like someone to suggest how to do that.

Link to comment
Share on other sites

Well, the referenced stylesheet build.xsl presumably already uses your imgsrc element to emit an <img> html element. So it appears you need to add xml for the other image attributes required, such as:
<imgsrc>images/sample.jpg</imgsrc> <imghref>your href for the image</imghref><imgtitle>your title for the image</imgtitle><imgalt>your alt text for the image</imgalt>

and update build.xsl to use these too.Post build.xsl if that's not clear and you'd like someone to suggest how to do that.

Okay, I think I know what to do. Here's the XSL thank you. . .<?xml version="1.0" encoding="ISO-8859-1"?><!-- DWXMLSource="build.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"><xsl:output method="html" encoding="ISO-8859-1" 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><title>Salvage Gold ::: Salvaged Cars For Sale in Southern California</title><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><!-- ImageReady Preload Script (salvagegold.psd) --><script type="text/javascript"><xsl:comment><xsl:text disable-output-escaping="yes"><![CDATA[function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; }}function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i<changeImages.arguments.length; i+=2) { document[changeImages.arguments].src = changeImages.arguments[i+1]; } }}var preloadFlag = false;function preloadImages() { if (document.images) { home_04_over = newImage("images/home_04-over.jpg"); home_05_over = newImage("images/home_05-over.jpg"); home_06_over = newImage("images/home_06-over.jpg"); home_07_over = newImage("images/home_07-over.jpg"); home_08_over = newImage("images/home_08-over.jpg"); home_09_over = newImage("images/home_09-over.jpg"); home_10_over = newImage("images/home_10-over.jpg"); home_11_over = newImage("images/home_11-over.jpg"); preloadFlag = true; }}// ]]></xsl:text></xsl:comment></script><!-- End Preload Script --><style type="text/css"><xsl:comment>body { background-color: #000000;}</xsl:comment></style><link href="sg_style.css" rel="stylesheet" type="text/css" /><style type="text/css"><xsl:comment>.style1 {color: #FFFFFF}.style2 { color: #333333; font-size: 9px; background-image: url(images/index_19.jpg); text-decoration: none; font-family: Arial, Helvetica, sans-serif;}.style3 {font-size: 9px; background-image: url(images/index_19.jpg); text-decoration: none; font-family: Arial, Helvetica, sans-serif;}</xsl:comment></style></head><body onload="preloadImages();"><!-- ImageReady Slices (salvagegold.psd) --><table width="1000" height="600" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" id="Table_01"> <!--DWLayoutTable--> <tr> <td height="300" colspan="11"> <img src="images/home_01.jpg" width="1000" height="300" alt="" /></td> </tr> <tr> <td width="101" rowspan="4" valign="top" bgcolor="#000000"> <img src="images/home_02.jpg" width="101" height="300" alt="" /></td> <td width="249" height="39"> <a href="news.html"><img src="images/home_03.jpg" alt="" width="249" height="39" border="0" /></a></td> <td width="60"> <a href="index.html" onmouseover="changeImages('home_04', 'images/home_04-over.jpg'); return true;" onmouseout="changeImages('home_04', 'images/home_04.jpg'); return true;" onmousedown="changeImages('home_04', 'images/home_04-over.jpg'); return true;" onmouseup="changeImages('home_04', 'images/home_04-over.jpg'); return true;"> <img src="images/home_04.jpg" alt="" name="home_04" width="60" height="39" border="0" id="home_04" /></a></td> <td width="81"> <a href="about.html" onmouseover="changeImages('home_05', 'images/home_05-over.jpg'); return true;" onmouseout="changeImages('home_05', 'images/home_05.jpg'); return true;" onmousedown="changeImages('home_05', 'images/home_05-over.jpg'); return true;" onmouseup="changeImages('home_05', 'images/home_05-over.jpg'); return true;"> <img src="images/home_05.jpg" alt="" name="home_05" width="81" height="39" border="0" id="home_05" /></a></td> <td width="84"> <img src="images/home_06-over.jpg" alt="" name="home_06" width="84" height="39" border="0" id="home_06" /></td> <td width="80"> <a href="sale.xml" onmouseover="changeImages('home_07', 'images/home_07-over.jpg'); return true;" onmouseout="changeImages('home_07', 'images/home_07.jpg'); return true;" onmousedown="changeImages('home_07', 'images/home_07-over.jpg'); return true;" onmouseup="changeImages('home_07', 'images/home_07-over.jpg'); return true;"> <img src="images/home_07.jpg" alt="" name="home_07" width="80" height="39" border="0" id="home_07" /></a></td> <td width="57"> <a href="sold.xml" onmouseover="changeImages('home_08', 'images/home_08-over.jpg'); return true;" onmouseout="changeImages('home_08', 'images/home_08.jpg'); return true;" onmousedown="changeImages('home_08', 'images/home_08-over.jpg'); return true;" onmouseup="changeImages('home_08', 'images/home_08-over.jpg'); return true;"> <img src="images/home_08.jpg" alt="" name="home_08" width="57" height="39" border="0" id="home_08" /></a></td> <td width="51"> <a href="faq.html" onmouseover="changeImages('home_09', 'images/home_09-over.jpg'); return true;" onmouseout="changeImages('home_09', 'images/home_09.jpg'); return true;" onmousedown="changeImages('home_09', 'images/home_09-over.jpg'); return true;" onmouseup="changeImages('home_09', 'images/home_09-over.jpg'); return true;"> <img src="images/home_09.jpg" alt="" name="home_09" width="51" height="39" border="0" id="home_09" /></a></td> <td width="57"> <a href="links.html" onmouseover="changeImages('home_10', 'images/home_10-over.jpg'); return true;" onmouseout="changeImages('home_10', 'images/home_10.jpg'); return true;" onmousedown="changeImages('home_10', 'images/home_10-over.jpg'); return true;" onmouseup="changeImages('home_10', 'images/home_10-over.jpg'); return true;"> <img src="images/home_10.jpg" alt="" name="home_10" width="57" height="39" border="0" id="home_10" /></a></td> <td width="81"> <a href="contact.html" onmouseover="changeImages('home_11', 'images/home_11-over.jpg'); return true;" onmouseout="changeImages('home_11', 'images/home_11.jpg'); return true;" onmousedown="changeImages('home_11', 'images/home_11-over.jpg'); return true;" onmouseup="changeImages('home_11', 'images/home_11-over.jpg'); return true;"> <img src="images/home_11.jpg" alt="" name="home_11" width="81" height="39" border="0" id="home_11" /></a></td> <td width="99"> <img src="images/home_12.jpg" width="99" height="39" alt="" /></td> </tr> <tr> <td height="25"> <img src="images/home_a_13.jpg" width="249" height="25" alt="" /></td> <td colspan="8"> <img src="images/home_14.jpg" width="551" height="25" alt="" /></td> <td rowspan="3" valign="top" bgcolor="#000000"> <img src="images/home_15.jpg" width="99" height="261" alt="" /></td> </tr> <tr> <td height="202" colspan="9" valign="top" bgcolor="#FFFFFF"><p class="title"><xsl:value-of select="style/header"/></p> <p class="body_text"><xsl:value-of select="style/body"/></p> <xsl:for-each select="style/list_item"> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <!--DWLayoutTable--> <tr> <td width="70" rowspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> <td width="142" height="22" valign="middle" bgcolor="#999999" class="CHART"><div align="center">PICTURE</div></td> <td width="85" valign="middle" bgcolor="#666666" class="CHART"><div align="center">YEAR</div></td> <td width="95" valign="middle" bgcolor="#666666" class="CHART"><div align="center">MAKE</div></td> <td width="111" valign="middle" bgcolor="#666666" class="CHART"><div align="center">MODEL</div></td> <td width="104" valign="middle" bgcolor="#666666" class="CHART"><div align="center">MILEAGE</div></td> <td width="104" valign="middle" bgcolor="#666666" class="CHART"><div align="center">PRICE</div></td> <td width="76" rowspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="64" valign="top" class="vehinfo"><img src="{imgsrc}" /></td> <td valign="middle" bgcolor="#CCCCCC" class="vehinfo"><div align="center"><xsl:value-of select="year"/></div></td> <td valign="middle" bgcolor="#CCCCCC" class="vehinfo"><div align="center"><xsl:value-of select="make"/></div></td> <td valign="middle" bgcolor="#CCCCCC" class="vehinfo"><div align="center"><xsl:value-of select="model"/></div></td> <td valign="middle" bgcolor="#CCCCCC" class="vehinfo"><div align="center"><xsl:value-of select="miles"/></div></td> <td valign="middle" bgcolor="#CCCCCC" class="vehinfo"><div align="center"><xsl:value-of select="price"/></div></td> </tr> <tr> <td height="8"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table> </xsl:for-each> </td> </tr> <tr> <td height="34" colspan="9" valign="top" background="images/home_19.jpg"><div align="center"><span class="footer"><a href="index.html"><br /> HOME</a> : <a href="about.xml" class="footer">ABOUT US</a> : </span><span class="style3"><a href="build.xml" class="style2">BUILDERS</a></span><span class="footer"> : <a href="sale.xml" class="footer">FOR SALE</a> : <a href="sold.xml" class="footer">SOLD</a> : <a href="faq.xml" class="footer">FAQ</a> : <a href="links.html" class="footer">LINKS</a> : <a href="contact.html" class="footer">CONTACT</a></span></div></td> </tr></table><!-- End ImageReady Slices --></body></html></xsl:template></xsl:stylesheet>
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...