xslt三种带图片的超链接(a标签,img标签)写法
來源:http://www.notsee.info/tech/XSLT/XSLT-detail-333.xml
第一種帶圖片的超鏈接寫法
?
xml
? <notsee ID="a002">
??????? <Name>分享交流互助,從看不見的地方找答案</Name>
??????? <img>notsee.gif</img>
??????? <url>http://www.notsee.info</url>
??? </notsee>
xsl
<xsl:element name="a">
??????????? <xsl:attribute name="href">
??????????????? <xsl:value-of select="./url"/>
??????????? </xsl:attribute>
??????????? <xsl:element name="img">
??????????????? <xsl:attribute name="src">
??????????????????? <xsl:value-of select="./img"/>
??????????????? </xsl:attribute>
??????????? </xsl:element>
</xsl:element>
?
第二種帶圖片的超鏈接寫法
xml 同上
xslt
? <a href="{url}">
??????????? <img src="{img}"/>
?</a>
因為{url}和<xsl:value-of select="url"/>是等價關系
?
第三種帶圖片的超鏈接寫法,http://notsee.info采用的多屬性方法,有點模擬a 標簽寫法
?
xml
<htmls><a order="1" title="head區域的代碼可以知道設計師的專業" href="http://www.notsee.info/tech/html/html-detail-71.xml" author="notsee">head區域的代碼可以知道設計師的專業</a><htmls>
xslt
<xsl:for-each?select="body/htmls/*">
-?<xsl:element?name="a">-?<xsl:attribute?name="href">??<xsl:value-of?select="@href"?/>??</xsl:attribute>-?<xsl:attribute?name="title">??<xsl:value-of?select="@title"?/>??</xsl:attribute>??<xsl:attribute?name="hidefocus">true</xsl:attribute>??<xsl:attribute?name="target">_blank</xsl:attribute>-?<span>??<xsl:value-of?select="@order"?/>??.??</span>??[HTML][??<xsl:value-of?select="@title"?/>??][??<xsl:value-of?select="@author"?/>??]??</xsl:element>??</xsl:for-each>創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎
總結
以上是生活随笔為你收集整理的xslt三种带图片的超链接(a标签,img标签)写法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 台式机dp接口_科普短文,高清晰音视频传
- 下一篇: struts2从一个action跳到另一