|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm trying to create a small list of links on the bottom of a webpage.
Desired Results: link1 link2 link3 XML file: <?xml version="1.0"?> <FMENU> <FITEM> <urltitle>link1</urltitle> <urllink>link1.html</urllink> </FITEM> <FITEM> <urltitle>link2</urltitle> <urllink>link2.html</urllink> </FITEM> <FITEM> <urltitle>link3</urltitle> <urllink>link3.html</urllink> </FITEM> </FMENU> HTML code: <table datasrc='#misclinks' > <tr> <td> <A DATAFLD="urllink"><SPAN DATAFLD="urltitle"></SPAN></A> </td> </tr> </table> Current Results: link1 link2 link3 I need the links to be displayed horizontially not vertically, any help greatly appreciated Last edited by izzzy12k : January 30th, 2004 at 07:28 PM. |
|
#2
|
|||
|
|||
|
Try
Code:
<table datasrc='#misclinks' > <tr> <td> <A DATAFLD="urllink" style="float:left;"><SPAN DATAFLD="urltitle"></SPAN></A> </td> </tr> </table> I'm sure there's a better way, but I no next to nothing about how MS's datasrc stuff works. |
|
#3
|
|||
|
|||
|
I still got
link1 link2 link3 I wonder if link1 link2 link3 is simply not possible? -Izzy |
|
#4
|
|||
|
|||
|
Try using this bookmarklet http://www.codehouse.com/javascript...ts/dhtml_snoop/ to see the actual html that is being generated. Getting the links side by side shouldn't be a problem.
|
|
#5
|
|||
|
|||
|
Well I've looked into it a little bit and it looks like MS's data islands can only iterate through an xml file using table rows. So you're not going to be able to align things horizontally easily. My suggestion would be to consider a javascript approach since you'll have more control that way.
Some helpful stuff: http://www.mozilla.org/xmlextras/xmldataislands/ http://www.perfectxml.com/msxmlIslands.asp http://msdn.microsoft.com/library/d.../dude110199.asp |
|
#6
|
|||
|
|||
|
I got it...
Thanks for your help... the snoop tool really helped me identify issues... Well here's the code ... just in case anyone else needs to do the same as i did. <table><tr><td> <script language="JavaScript"> <!-- ; Document = misclinks.XMLDocument; x = Document.documentElement.childNodes.length; y = 0 while (y < x) { titles = Document.documentElement.childNodes(y).childNodes(0).text; urls = Document.documentElement.childNodes(y).childNodes(1).text; document.write(" <a href=" + urls + " " + titles + "</a> ") y+=1 } // end hide --> </script> </td></tr></table> Last edited by izzzy12k : February 3rd, 2004 at 11:56 AM. |
|
#7
|
|||
|
|||
|
Document = misclinks.XMLDocument;
refers to: <xml src="bottom-menu.xml" id="misclinks"></xml> in the HTML page |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Create Menu using XML data on a webpage |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|