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 11th, 2003, 02:12 PM
lewinmg lewinmg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Atlanta, GA
Posts: 6 lewinmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
adding xml links to html web page

I know this might be easy for everyone. Im having a hard time finding a simple example of this.

All i want to do is have an xml file of links and then show them in my main html web page, and make them clickable...

anyone have a simple example??

Reply With Quote
  #2  
Old November 11th, 2003, 02:53 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,357 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 7 h 10 m 45 sec
Reputation Power: 787
Show an example of your XML file.

Are you using HTML or XHTML?
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old November 11th, 2003, 02:56 PM
lewinmg lewinmg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Atlanta, GA
Posts: 6 lewinmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
HTML, but i can change to XHTML if thats easier.

Reply With Quote
  #4  
Old November 11th, 2003, 02:59 PM
lewinmg lewinmg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Atlanta, GA
Posts: 6 lewinmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I dont even have an example of the xml..
Im assuming it'd be something like this..

<archive>
<link name="10/10/2001" href="archive/101001.html" />
</archive>

Reply With Quote
  #5  
Old November 11th, 2003, 03:14 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,357 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 7 h 10 m 45 sec
Reputation Power: 787
If you want a specific answer you'll need to provide a specific XML example for us to work with. Let me know so I'm not wasting time.

Reply With Quote
  #6  
Old November 11th, 2003, 03:58 PM
lewinmg lewinmg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Atlanta, GA
Posts: 6 lewinmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ok,

then the xml would look like this

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

Reply With Quote
  #7  
Old November 11th, 2003, 04:27 PM
lewinmg lewinmg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Atlanta, GA
Posts: 6 lewinmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Jeremy, thanks, but i was finally able to find an example of this on the net after searching all day....

for anyone that is interested in a working example of this..

here they are..

THE XML: (save as linktest.xml)

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="linktest.xsl"?>
<CODEHELP>
<!--Test file from www.codehelp.co.uk-->
<NAVIGATE>
<FILE>../xml/anyfile.xml</FILE>
<DESC>Change the FILE entry to point to a real file</DESC>
<CLICK>A test link only</CLICK>
</NAVIGATE>
<NAVIGATE>
<FILE>../xml/anyfile2.html</FILE>
<DESC>Add more navigate/file/desc/click tags for more links</DESC>
<CLICK>Adding more links</CLICK>
</NAVIGATE>
</CODEHELP>



THE XSL (save as linktest.xsl)

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
<html>
<HEAD>
<link rel="stylesheet" href="../css/content.css" type="text/css"/>
<title>Test</title>
</HEAD>
<BODY>

<div style="position:absolute;top:20%;left:20%;">
<h1>These links are not all active.</h1>
<h3>Hover over each link to get more information.</h3>
<ul style="line-height:1.7;">
<li><a href="anyfile.xml" title="This could be your home page - added to all XML's">Your home page?</a></li>
<xsl:apply-templates select="CODEHELP/NAVIGATE" />
<h4>These next links are active</h4>
<li><a href="../links/index.html" title="Link to html, xml, shtml, use relative as well as absolute links">Links</a></li>
<li>Return to the <a href="../index.html" title="Home page">CodeHelp home page</a> here.</li>
<li>Go back to the <a href="seventh.xml" title="test files page">previous file</a> here.</li>
</ul>
</div>

</BODY>
</html>
</xsl:template>
<xsl:template match="CODEHELP/NAVIGATE">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="FILE"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="DESC"/>
</xsl:attribute>
<xsl:value-of select="CLICK"/>
</a>
</li>
</xsl:template>

</xsl:stylesheet>


put them in the same directory on a hosted server and just run the linktest.xml

the links dont actually go anywhere but the syntax works.

Reply With Quote
  #8  
Old November 11th, 2003, 04:34 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,357 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 7 h 10 m 45 sec
Reputation Power: 787
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output 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>

Reply With Quote
  #9  
Old November 11th, 2003, 08:40 PM
lewinmg lewinmg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Atlanta, GA
Posts: 6 lewinmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yours is alot easier...thanks

Reply With Quote
  #10  
Old December 1st, 2003, 09:09 AM
puneett puneett is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 2 puneett User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
External XML Files

What about External XML Files where you cannot specify the the style sheet in the XML File?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > adding xml links to html web page


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 6 hosted by Hostway