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 November 26th, 2003, 06:19 PM
TPazz TPazz is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 TPazz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Reading URLs from XML document

Hi,

I have saved url's in a xml file. Now I want to display the information in the XML file on a web page. I know how to do this but how do I get my URLs read from the XML file to show up as hyper links so that users can click on them and go to the specific url read from the xml file?

Please help,

TPazz

Reply With Quote
  #2  
Old November 28th, 2003, 06:42 AM
mikefmi mikefmi is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 mikefmi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Maybe you should try with XSLT...

Reply With Quote
  #3  
Old November 28th, 2003, 07:39 AM
RogueGunner's Avatar
RogueGunner RogueGunner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 64 RogueGunner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 5
=)

Sample XML FILE your reading from:
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="xmltest2.xsl"?>
<link>
<text>Google</text>
<url>http://www.google.com</url>
</link>



Sample XLS file your using to format etc....
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" />
<xsl:template match="/">
<xsl:for-each select="link">
<p><a href="{url}"><xsl:value-of select="text" /></a></p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

i just found the answer out too put i wanted to share =) i don't take the credit on this

Reply With Quote
  #4  
Old November 28th, 2003, 10:16 PM
TPazz TPazz is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 TPazz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks

Thanks for your help! It works great!

Reply With Quote
  #5  
Old November 28th, 2003, 10:20 PM
RogueGunner's Avatar
RogueGunner RogueGunner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 64 RogueGunner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 5
you wouldn't happen to know how to output the contents of a element that has spaces:

example:
http://www.teamwarfare.com/xml/view...asp?team=MavCom

Notice how
the tag "Ladder Name"

has spaces - a xsl file won't let you use spaces!

i am lost!

Reply With Quote
  #6  
Old December 3rd, 2003, 03:45 PM
tsprings tsprings is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Seattle, WA
Posts: 55 tsprings User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 5
Hello Roguegunner. You should visit: http://www.w3schools.com/xml/xml_syntax.asp and read up on XML. In your XML document you have this:
Code:
<ladder name="CoD: North America - Retrieval 4v4">

In XML, ladder is the name of the element, whereas name is an attribute (as you said in a previous posting elsewhere on the site). This is built into XML. If you wanted to select this data in your XML document, you would code:
Code:
<xsl:value-of select="team/competitioninformation/ladder/@name" />

If you changed your element so that it was instead:
Code:
<ladderName>CoD: North America - Retrieval 4v4</ladderName>

Then to select it, you could code this instead:
Code:
<xsl:value-of select="team/competitioninformation/ladderName" />

But it would probably end up displaying all the information found inside that element which would be much more than just "CoD: North America - Retrieval 4v4".

Reply With Quote
  #7  
Old December 3rd, 2003, 04:00 PM
RogueGunner's Avatar
RogueGunner RogueGunner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 64 RogueGunner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 sec
Reputation Power: 5
Hey Thanks for helping me out =)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Reading URLs from XML document


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 2 hosted by Hostway
Stay green...Green IT