How to create an XSLT relationship

Hi, I made a php webservice that returns some xml that is converted to html using the xml file I have. But I want to be able to click on each returned item to get more detailed information about this item. <a href="item.php?id=<?php echo $itemid"?>"> <?php echo $itemname"?> </a> Recently I did the same, but in PHP, ive tried to use this in XSLT, but it does not work.

+4
source share
1 answer

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, a shorter form:

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

Should also work

+10
source

Source: https://habr.com/ru/post/1305057/


All Articles