|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am very new to XML and have literally only learned what I needed to do, which was create an xml file with a menu in, pulled in to the main html page with a bit of code
However, when pulled in, works great, except I dont know how to apply a hyperlink to each of the rows in the table? Is this possible? This is the XML file I created <?xml version="1.0" encoding="iso-8859-1" ?> <LEFTMENU> <MENUITEM> <LINE1> Home </LINE1> </MENUITEM> <MENUITEM> <LINE1> Downloads </LINE1> </MENUITEM> <MENUITEM> <LINE1> LearnDirect </LINE1> </MENUITEM> <MENUITEM> <LINE1> Boldon Phonebook </LINE1> </MENUITEM> <MENUITEM> <LINE1> Outlook Web Access </LINE1> </MENUITEM> <MENUITEM> <LINE1> Sales Team Diary </LINE1> </MENUITEM> <MENUITEM> <LINE1> IT Server Status </LINE1> </MENUITEM> </LEFTMENU> and it is then pulled in using the following code <xml src="quicklinks.xml" id="xmldso" async="false"> </xml> <table datasrc="#xmldso" width="140" border="0"> <thead> <th> <p align="left"> <font face="Verdana" style="font-size: 8pt; text-decoration:underline">Quicklinks</font> </th> </thead> <tr align="left"> <td> <font face="Verdana" style="font-size: 8pt"> <span datafld="LINE1"></span> </font> </td> </tr> </table> Can anybody help me with this Thanks Tommy |
|
#2
|
|||
|
|||
|
just to expand on my initial post.....
I've tried the post that contains the "yada" code, but this relies on an xsl file Using the code from my first post, I can then pull in the necessary columns from the xml file but it loses its formatting. I'm working with index.htm page and I want to keep it like that, but still pull in XML information...with Hyperlinks included! Is this even possible?? |
|
#3
|
|||
|
|||
|
i hope this is what u r looking for
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl utput method="html" indent="no" encoding="utf-8"/><xsl:template match="/"> <table datasrc="#xmldso" width="140" border="0"> <thead> <th> <p align="left"> <font face="Verdana" style="font-size: 8pt; text-decoration:underline">Quicklinks</font> </p> </th> </thead> <xsl:for-each select="/LEFTMENU/MENUITEM/LINE1"> <xsl:variable name="v_line" select="normalize-space(.)"/> <tr align="left"> <td> <font face="Verdana" style="font-size: 8pt"> <!--<xsl:value-of select="$v_line"/>--> <span datafld="LINE1"><a href="{$v_line}"><xsl:value-of select="."/></a> </span> </font> </td> </tr> </xsl:for-each> </table> </xsl:template> </xsl:stylesheet> ---------------------- hope this code helps u regards niha |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML Hyperlink |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|