By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,837 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,837 IT Pros & Developers. It's quick & easy.

xlinks not showing up in browser

P: 57
Hi,
I've set up some basic xlinks, just like on the w3 tutorial, but they're not showing up in a browser (IE6 or FF2). Anybody know why? Do they only work when used w/XSL? I'm so confused why they aren't working...

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2.  
  3. <rootElement xmlns:xlink="http://www.w3.org/1999/xlink">
  4.     <element>
  5.         <title>Google</title>
  6.         <www xlink:type="simple" xlink:href="http://www.google.com" xlink:actuate="onRequest">Go to google.com</www>
  7.     </element>
  8. </rootElement>
  9.  
I have an external javascript to load the xml doc and another js to display the data (w/links I had hoped, but no). I was assuming when the <www> node loads, it would be a link that could be clicked on.

Thanks!
Jun 24 '07 #1
Share this Question
Share on Google+
10 Replies


Dököll
Expert 100+
P: 2,364
Hi,
I've set up some basic xlinks, just like on the w3 tutorial, but they're not showing up in a browser (IE6 or FF2). Anybody know why? Do they only work when used w/XSL? I'm so confused why they aren't working...

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2.  
  3. <rootElement xmlns:xlink="http://www.w3.org/1999/xlink">
  4.     <element>
  5.         <title>Google</title>
  6.         <www xlink:type="simple" xlink:href="http://www.google.com" xlink:actuate="onRequest">Go to google.com</www>
  7.     </element>
  8. </rootElement>
  9.  
I have an external javascript to load the xml doc and another js to display the data (w/links I had hoped, but no). I was assuming when the <www> node loads, it would be a link that could be clicked on.

Thanks!
I'll have a look at this after work today, npm!

Please stay tuned!
Jun 25 '07 #2

P: 57
npm
Anybody have an idea why this wouldn't be working like I thought it should?

Thanks!
Jul 7 '07 #3

Dököll
Expert 100+
P: 2,364
Thank you for your patience!

I like to refer every one to the following:http://www.w3schools.com/xlink/xlink_intro.asp

Please write if this does not work...
Jul 7 '07 #4

P: 57
npm
I've read that tutorial a bunch of times to try and make sure I'm not forgetting anything. From what I can tell, I have the xml all set up the way they describe it there. The links aren't showing up when I view on my computer or from the web server.
Jul 7 '07 #5

Dököll
Expert 100+
P: 2,364
I've read that tutorial a bunch of times to try and make sure I'm not forgetting anything. From what I can tell, I have the xml all set up the way they describe it there. The links aren't showing up when I view on my computer or from the web server.
Try this one:

http://www.w3schools.com/xlink/xlink_example.asp

It works at my end:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="ISO-8859-1"?><bookstore xmlns:xlink="http://www.w3.org/1999/xlink"><book title="Harry Potter">
  2.   <description
  3.   xlink:type="simple"
  4.   xlink:href="http://book.com/images/HPotter.gif"
  5.   xlink:show="new">
  6.   As his fifth year at Hogwarts School of Witchcraft and
  7.   Wizardry approaches, 15-year-old Harry Potter is.......
  8.   </description>
  9. </book><book title="XQuery Kick Start">
  10.   <description
  11.   xlink:type="simple"
  12.   xlink:href="http://book.com/images/XQuery.gif"
  13.   xlink:show="new">
  14.   XQuery Kick Start delivers a concise introduction
  15.   to the XQuery standard.......
  16.   </description>
  17. </book></bookstore>
Please give it a go and let us know.

In a bit!
Jul 9 '07 #6

P: 57
npm
It still didn't work on my end. A couple questions:

1. What OS/browser are you using? I'm using Windows XP SP2 and Firefox 2.0.0.4, although it didn't show up in IE6 either.

2. The initial xlink declaration (xmlns:xlink="http://www.w3.org/1999/xlink") is in the root element. Does it need to go in the direct parent element of the element I want hyperlinked, even if that parent element isn't the root element?

Thanks again for your help!
Jul 9 '07 #7

P: 57
npm
I also tried hardcoding the html <a> tags inside the xml tags:

Expand|Select|Wrap|Line Numbers
  1. <xmltag>&lta href="http://www.wherever.com"&gtwherever.com&lt/a&gt</xmltag>
  2.  
This works and the link shows up in the browser, but I'd rather not do it this way.
Jul 9 '07 #8

Dököll
Expert 100+
P: 2,364
I also tried hardcoding the html <a> tags inside the xml tags:

Expand|Select|Wrap|Line Numbers
  1. <xmltag>&lta href="http://www.wherever.com"&gtwherever.com&lt/a&gt</xmltag>
  2.  
This works and the link shows up in the browser, but I'd rather not do it this way.
Using IE7, though I think you should still be able to see it in 6. I should perjhaps tell you, you probably have it working and do not know. The link, and I should have been a little precise, is embedded within an image, so if you do not have an image, you will have nothing to click on, but you cursor will come alive if hovr over the area where you know the link should be. Try that, or add an image in the same folder the files are stored, fire it up then...

Sorry for your troubles!
Jul 10 '07 #9

P: 57
npm
Sorry it took so long to get back to your last reply.

So...the whole xlink thing only works if you want to click on an image, not text?
Jul 30 '07 #10

P: 57
npm
I thought the text itself would be the link. At least, that's what I gathered from the W3Schools tutorial.

Thanks!
Aug 30 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.