N
naija naija
Hi Guys,
I want my Submenu in TreeView to have hyperlinks and 'm populating my
TreeView from a Xml file and formatting it with XSL.
I want to have hyperlinks on elements authors,year,business etc..
Any idea and help!
XML,XSL file below:-
XML file
--------------
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book price="34.95">
<title>Corporate</title>
<authors>
<author>Mitchell</author>
<author>Atkinson</author>
</authors>
<year>1999</year>
<business>1</business>
</book>
</books>
XSL File:-
-----------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:template match="/books">
<TREENODES>
<xsl:for-each select="book">
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="title" />
</xsl:attribute>
<treenode>
<xsl:attribute name="text">
Price - $<xsl:value-of select="@price" />
</xsl:attribute>
</treenode>
<treenode text="Authors">
<xsl:for-each select="authors/author">
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="text()" />
</xsl:attribute>
</treenode>
</xsl:for-each>
</treenode>
<treenode>
<xsl:attribute name="text">
Year Published - <xsl:value-of select="year" />
</xsl:attribute>
</treenode>
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="business"/>
</xsl:attribute>
</treenode>
</treenode>
</xsl:for-each>
</TREENODES>
</xsl:template>
</xsl:stylesheet>
I want my Submenu in TreeView to have hyperlinks and 'm populating my
TreeView from a Xml file and formatting it with XSL.
I want to have hyperlinks on elements authors,year,business etc..
Any idea and help!
XML,XSL file below:-
XML file
--------------
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book price="34.95">
<title>Corporate</title>
<authors>
<author>Mitchell</author>
<author>Atkinson</author>
</authors>
<year>1999</year>
<business>1</business>
</book>
</books>
XSL File:-
-----------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:template match="/books">
<TREENODES>
<xsl:for-each select="book">
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="title" />
</xsl:attribute>
<treenode>
<xsl:attribute name="text">
Price - $<xsl:value-of select="@price" />
</xsl:attribute>
</treenode>
<treenode text="Authors">
<xsl:for-each select="authors/author">
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="text()" />
</xsl:attribute>
</treenode>
</xsl:for-each>
</treenode>
<treenode>
<xsl:attribute name="text">
Year Published - <xsl:value-of select="year" />
</xsl:attribute>
</treenode>
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="business"/>
</xsl:attribute>
</treenode>
</treenode>
</xsl:for-each>
</TREENODES>
</xsl:template>
</xsl:stylesheet>