XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2004, 03:20 PM
izzzy12k izzzy12k is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 17 izzzy12k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 58 sec
Reputation Power: 0
Question Need Help using XML generated menu in a webpage

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.

Reply With Quote
  #2  
Old January 30th, 2004, 11:30 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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.

Reply With Quote
  #3  
Old February 2nd, 2004, 10:46 AM
izzzy12k izzzy12k is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 17 izzzy12k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 58 sec
Reputation Power: 0
I still got

link1
link2
link3

I wonder if

link1 link2 link3

is simply not possible?

-Izzy

Reply With Quote
  #4  
Old February 2nd, 2004, 12:32 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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.

Reply With Quote
  #5  
Old February 2nd, 2004, 03:40 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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

Reply With Quote
  #6  
Old February 2nd, 2004, 06:46 PM
izzzy12k izzzy12k is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 17 izzzy12k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 58 sec
Reputation Power: 0
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("&nbsp;<a href=" + urls + " " + titles + "</a>&nbsp;")
y+=1
}
// end hide -->
</script>

</td></tr></table>

Last edited by izzzy12k : February 3rd, 2004 at 11:56 AM.

Reply With Quote
  #7  
Old February 2nd, 2004, 06:48 PM
izzzy12k izzzy12k is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 17 izzzy12k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 58 sec
Reputation Power: 0
Document = misclinks.XMLDocument;

refers to:
<xml src="bottom-menu.xml" id="misclinks"></xml>

in the HTML page

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Create Menu using XML data on a webpage


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT