469,268 Members | 1,023 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,268 developers. It's quick & easy.

XML with hyperlink

KL
I am totally new to XML and confused as heck. I have my xml file and want
one of my elements to be a website. Heck I even named the element website
(I know real original), but I can't make the website show as a valid
hyperlink in my html file. Any suggestions on what I am missing??

--

KL

"You don't love someone because they are beautiful, they are beautiful
because you love them." - Anon.

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 20 '05 #1
6 4704
KL wrote:
I am totally new to XML and confused as heck. I have my xml file and want
one of my elements to be a website. Heck I even named the element
website (I know real original), but I can't make the website show as a
valid hyperlink in my html file. Any suggestions on what I am missing??


Your message is missing any indication as to how you are trying to transform
your XML into (X)HTML.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #2
KL
David Dorward wrote:
KL wrote:
I am totally new to XML and confused as heck. I have my xml file
and want one of my elements to be a website. Heck I even named the
element website (I know real original), but I can't make the website
show as a valid hyperlink in my html file. Any suggestions on what
I am missing??


Your message is missing any indication as to how you are trying to
transform your XML into (X)HTML.

I am linking to the XML file in my HTML file:

<html>
<head>
<title>RPG's</title>
</head>

<body>
<xml id="rpg" src="games.xml"></xml>

<table border="10" bordercolordark="#330066" bordercolorlight="#9900FF"
cellpadding="3">
<tr><td colspan="3" align="center" width="825" height="325"><img
id="picture" datasrc="#rpg" datafld="pic"></img></td></tr>
<tr><td colspan="3" align="center"><div id="name" datasrc="#rpg"
datafld="name"></div></td></tr>
<tr><td colspan="3" align="center"><span id="website" datasrc="#rpg"
datafld="website"></span></td></tr>
<tr><td align="center"><div id="character" datasrc="#rpg"
datafld="char"></div></td>
<td align="center"><div id="race" datasrc="#rpg" datafld="race"></div></td>
<td align="center"><div id="job" datasrc="#rpg"
datafld="job"></div></td></tr>
</table>
<br>
<br>
<table border="0">
<tr><td align="center" width="825"><button
onClick="rpg.recordset.moveFirst()">&lt;&lt; First Record</button>
<button onClick="rpg.recordset.movePrevious(); if (rpg.recordset.BOF)
rpg.recordset.moveFirst()">&nbsp;&nbsp;&lt; Previous
Record&nbsp;&nbsp;</button>
<button onClick="rpg.recordset.moveNext(); if (rpg.recordset.EOF)
rpg.recordset.moveLast()">&nbsp;&nbsp;Next Record&gt;&nbsp;&nbsp;</button>
<button onClick="rpg.recordset.moveLast()">&nbsp;&nbsp;Las t
Record&gt;&gt;&nbsp;&nbsp;</button></td></tr>
</body>

</html>

Hope this makes sense.
--

KL

"You don't love someone because they are beautiful, they are beautiful
because you love them." - Anon.

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 20 '05 #3
It was somewhere outside Barstow when "KL" <kl*******@aohell.com>
wrote:
I am linking to the XML file in my HTML file: <xml id="rpg" src="games.xml"></xml> <tr><td colspan="3" align="center" width="825" height="325"><img
id="picture" datasrc="#rpg" datafld="pic">


Why do you think this "datasrc" and "datafld" rubbish will help ?

Out of sheer curiosity, which obsolete M$oft textbook were you reading
when you saw this ? It never worked right, it never worked outside
M$oft, and it's a bad idea for all sorts of reasons. I know many
people have been misled down this dead-end before, but you're the
first I've seen in a few years.

Do it with XSLT, on the server. If you need a book (you will, XSLT is
complex), then I'd recommend Michael Kay's.

You can also do it client-side, but there are serious portability
issues with that.

Jul 20 '05 #4
KL
Andy Dingley wrote:
It was somewhere outside Barstow when "KL" <kl*******@aohell.com>
wrote:
I am linking to the XML file in my HTML file:

<xml id="rpg" src="games.xml"></xml>

<tr><td colspan="3" align="center" width="825" height="325"><img
id="picture" datasrc="#rpg" datafld="pic">


Why do you think this "datasrc" and "datafld" rubbish will help ?

Out of sheer curiosity, which obsolete M$oft textbook were you reading
when you saw this ? It never worked right, it never worked outside
M$oft, and it's a bad idea for all sorts of reasons. I know many
people have been misled down this dead-end before, but you're the
first I've seen in a few years.

Do it with XSLT, on the server. If you need a book (you will, XSLT is
complex), then I'd recommend Michael Kay's.

You can also do it client-side, but there are serious portability
issues with that.

Well, it is part of the college class that I am taking. Needless to say, it
is extremely aggravating that I can't get it to work. But the book on XML
said to use that datasrc and datafld. We are to make the XML database,
which I did fine, and them link it into an HTML file with buttons to go from
previous to last. I can't get it to do the hyperlink. If I could figure
out what I am doing wrong, or how to approach it, I think I could figure it
out.
--

KL

"You don't love someone because they are beautiful, they are beautiful
because you love them." - Anon.

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 20 '05 #5
It was somewhere outside Barstow when "KL" <kl*******@aohell.com>
wrote:
Well, it is part of the college class that I am taking.
Change college ?
Needless to say, it
is extremely aggravating that I can't get it to work. But the book on XML
said to use that datasrc and datafld.


Yeah, well it's wrong.

W R O N G

Jul 20 '05 #6
It was somewhere outside Barstow when "KL" <kl*******@aohell.com>
wrote:
I am linking to the XML file in my HTML file:


I appreciate my brief comments in the other post might not be so
helpful.

Google this newsgroup and you'll see past critiques of why DSO is a
poor way to use XML.
<http://groups.google.co.uk/gr************************************************ *********************@codesmiths.com&lr=&hl=en>
Equally styling XML with CSS alone is a bad idea. It may work, but
it's very inflexible (Google c.i.w.a.h for why)
As an alternative, then for commercial web work you really need to use
a server-side XSLT transform into "plain" HTML. This works on all
client devices and it's the only really practical approach.
For intranets, or as "bells and whistles" teaching exercises, then you
can use IE-specific techniques like data islands. These use XSLT on
the client side.

Use some JavaScript like this, called from the onload event.:
document.all.divDest.innerHTML
= xmlSource.transformNode (xslStylesheet);

and HTML like this :

<html>

[...]

<body>

<div id="divDest" >This gets over-written by the XML transformed
content</div>

<xml id="xmlSource" src="games.xml"></xml>
<xml id="xslStylesheet" src="games_to_html_content.xsl"></xml>

</body>
</html>

You can still use the Next/Prev buttons, just pass an ID into the
stylesheet as a parameter. You'll find the MSXML SDK (downloadable
from M$oft) has a useful help file with code examples.
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ryan Harvey | last post: by
5 posts views Thread by Martin Dew | last post: by
9 posts views Thread by Leon | last post: by
19 posts views Thread by Joe | last post: by
8 posts views Thread by Nathan Sokalski | last post: by
20 posts views Thread by tshad | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.