开发者

How to generate link with XSLT

Hi i've made a php webservice that returns some xml which is transformed into html by an XML file i have . But i want to be able to click on each returned item to get more details about that item. <a href="item.php?id=<?php echo $itemid"?>"> <?php echo $itemname"?> </a>开发者_运维技巧; Recently i did the same thing but in PHP, ive tried to use this in XSLT but it doesn't work.


Use xsl:attribute:

<a>
   <xsl:attribute name="href">item.php?id=<xsl:value-of select="ItemId" /></xsl:attribute>
   <xsl:value-of select="ItemName" />
</a>

Alternatively, the shorter form:

<a href="item.php?id={ItemId}"><xsl:value-of select="ItemName" /></a>

Should also work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜