I designed a xslt file for a list view of house names from xml. And when a house name is clicked from the list, it should show full detail of the house which is in same xml file. But in my case it's redirecting to another place. Can someone help me?
<Houses>
<search>
<id>1</id>
<name>horror</name>
<address>09, west Road</address>
<city>London</city>
<pcode>se4 7jk</pcode>
<contact>020574110832</contact>
</search>
</Houses>
And the problem part of xslt file
<xsl:template match="name">
<xsl:attribute name="href">
<xsl:value-of select="//search/name"/>
</xsl:attribute>
</xsl:template>
I assume you wish to add a link to each name. In that case you will need something like
This will create elements like
<a href="#horror">horror</a>
EDIT
OK here's an example of a table with div elements that collapse/expand by clicking the button. Nice layout I left to do for you; it's just meant as an example of how to create an html using xslt including javascript toggle hide/show.
When applied to
This gives
Try it out in a browser and you will experience the expand/collapse behavior.