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 July 22nd, 2004, 12:23 AM
rebbit rebbit is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 84 rebbit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 7 m
Reputation Power: 5
Storing URLs in XML files

I started with XML a bit recently, and have run into a little trouble. I have an XML file that I want to use as a source for a table. The table is a menu, so I want the link addresses to be specified in the XML file, so they can be changed in just the XML file to prevent having to change all the pages of the site. How can I do this?

I figured this wouldn't work, but I tried it anyway:

Code:
...
<menu>
  <item>
    <href><a href='index.html'>Home</a></href>
    <desc>Back to the homepage</desc>
  </item>
  ...
</menu>


so, how can I have it so the url is specified in the XML file? any help much appreciated

Reply With Quote
  #2  
Old July 22nd, 2004, 10:33 AM
kid23 kid23 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 62 kid23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
The first thing to say, if you don't know it already, is that tags in XML have no predefined meaning, it's the author who will decide what to do with them. Some questions can be raised from this assumption:

Question n°1 : which application will use the XML file as input ?

If you're willing to see the XML file in IE, you're gonna have to tell IE what the tags mean, this is done by transforming the file with XSLT, look for a tutorial if this is what you're trying to do.

If it's a custom application, then this application will have to support any name you choose for your tags, and adjust the processing based on the tags.

Question n°2 : Why sticking to HTML naming conventions ?

Your XML file could have custom, more explicit tags, like this :

<Link URL="http://www.anywhere.com" Text="A cool site" />

...

Don't forget that XML gives you the freedom to do what you want, but that YOU have to tell him what to do with the content.

Hope this helps

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Storing URLs in XML files


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


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





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