以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  [求助]请教一个XSL加载图片超连接的问题!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=48592)


--  作者:皇帝宇
--  发布时间:6/16/2007 3:28:00 PM

--  [求助]请教一个XSL加载图片超连接的问题!
这是我的XML:

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2007 sp2 (http://www.altova.com)-->

<?xml-stylesheet type="text/xsl" href="Volutidae.xsl"?>
<PRODUCTS>
 <Shell ID="01">
  <Barcode_NO>110.88.01</Barcode_NO>
  <Name type="latin">Alcithoe swainsoni</Name>
  <Photo title="Click to view larger version" datetaken="String" alt="Sorry, no photo available" view="above">thumbnails/1_1.jpg</Photo>
  <LinkTo>images/1_1.jpg</LinkTo>
  <Photo title="Click to view larger version" datetaken="String" alt="Sorry, no photo available" view="under">thumbnails/1_2.jpg</Photo>
  <LinkTo>images/1_2.jpg</LinkTo>
  <Size unit="mm">109mm 104mm 99mm F+ / F++</Size>
  <Description>Set of 3 patterns 109mm 104mm 99mm F+ / F++  Minor chips, growth lines &amp; sands All 3 have nice intact protoconchs which is hard to find. Lightest form washed up on Raglan Beach Other two from a washup in Palliser Bay New Zealand
</Description>
  <ProductTypeName>Volutidae</ProductTypeName>
  <Price CURRENCY="NZ$">10</Price>
 </Shell>
 <Shell ID="02">
  <Barcode_NO>110.88.02</Barcode_NO>
  <Name type="latin">Alcithoe fusus</Name>
  <Photo title="Click to view larger version" datetaken="String" alt="Sorry, no photo available" view="above">thumbnails/1_3.jpg</Photo>
  <LinkTo>images/1_1.jpg</LinkTo>
  <Photo title="Click to view larger version" datetaken="String" alt="Sorry, no photo available" view="under">thumbnails/1_4.jpg</Photo>
  <LinkTo>images/1_1.jpg</LinkTo>
  <Size unit="mm">62mm  Fine</Size>
  <Description>62mm Fine Chipped protoconch and lower lip. Crabbed in rockpool at low tide. Purakainui, Otago New Zealand</Description>
  <ProductTypeName>Volutidae</ProductTypeName>
  <Price CURRENCY="NZ$">10</Price>
 </Shell>

这是我的XSL

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="/">
  <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
 <title>Volutidae</title>

<xsl:for-each select="PRODUCTS/Shell[ProductTypeName='Volutidae']">
     <tr>
      <table width="1000">
       <form name="myform">
        <tbody>
         <tr>
          <xsl:for-each select="Photo">
           <td width="100" align="left">
            <a>
             <xsl:attribute name="href">javascript:openPix('<img src="{LinkTo}"/>', 'Amalda australis')</xsl:attribute>
             <img>
              <xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
              <xsl:attribute name="alt">click to view large photo</xsl:attribute>
              <xsl:attribute name="border">1</xsl:attribute>
             </img>
            </a>
           </td>
          </xsl:for-each>
          <td width="100" align="left">
           <xsl:value-of select="Name"/>
          </td>
          <td width="160" align="left">
           <xsl:value-of select="Size"/>
           <br/>
           <xsl:value-of select="Description"/>
           <br/>
          </td>
          <td width="100" align="left">$
         <xsl:value-of select="Price"/>
          </td>
</tbody>
       
      </table>
      <br/>
      <hr/>
      <br/>
     </tr>
    </xsl:for-each>
   </body>
  </html>
 </xsl:template>
</xsl:stylesheet>

我的图片超连接总是不能显示

请问有高手可以指点吗?


--  作者:Qr
--  发布时间:6/16/2007 9:34:00 PM

--  
从图片超连接的代码中看,代码没有问题,只是你的XSL根本不符合XML的规范,XML的标记都是成对出现。低级的错误,问题指出来了,自己看着改吧。


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms