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

XLink to other sites?

P: n/a
I'm fairly new at using XML XSL and XLink, and I was wondering how I
could use the three to create a menu link to another page (i.e. a menu
button "Contact Us" would link to a seperate contact page). I've tried
implementing XLink, but I seem to be failing. If I use it properly,
would the link show up on an XML file (the one I am viewing through
XSLT) as a hyperlink to another site (like any <a href>?). This seems
to be my major barrier. Any help is really appreciated.
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a


eagle0Nine wrote:
I'm fairly new at using XML XSL and XLink, and I was wondering how I
could use the three to create a menu link to another page (i.e. a menu
button "Contact Us" would link to a seperate contact page). I've tried
implementing XLink, but I seem to be failing. If I use it properly,
would the link show up on an XML file (the one I am viewing through
XSLT) as a hyperlink to another site (like any <a href>?). This seems
to be my major barrier. Any help is really appreciated.


If you use XSLT then you can transform to HTML and use HTML links, that is
<a href="whatever.html">link text</a>
elements.
I am not sure what you want to use XLink for, Mozilla 1.4 I think
supports simple XLinks but other browsers don't do that.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

P: n/a
OK, that doesn't help. So... how would I place a link like <a
href="whatever.html"> in an XML document, as opposed to the XSL?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

P: n/a


Chris Barajas wrote:
OK, that doesn't help. So... how would I place a link like <a
href="whatever.html"> in an XML document, as opposed to the XSL?


Well, there is XHTML, and XML allows elements with different namespaces
so you could have
<a xmlns="http://www.w3.org/1999/xhtml"
href="http://javascript.faqts.com/">JavaScript.FAQTs</a>
as an XHTML link in an XML document, for instance

<?xml version="1.0" encoding="UTF-8"?>
<para>
This is text followed by an XHTML link
<a xmlns="http://www.w3.org/1999/xhtml"
href="http://javascript.faqts.com/">JavaScript.FAQTs</a>
</para>

Save that .xml and browser like Opera 7 or Netscape 7 which have
XML/XHTML support will recognize the XHTML namespace on the <a> element
and render it as a clickable link, just like in an HTML document.
But IE5/6/Win doesn't support that.

Or make any element an XLink:

<mylink xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:show="replace"
xlink:href="http://javascript.faqts.com/">JavaScript.FAQTs</mylink>

but only Mozilla based browsers like Netscape 7 then make that element a
clickable link, and you also need to apply some CSS to have the normal
underline look and the normal link color:

para {
display: block;
margin: 0.2em;
}
mylink {
text-decoration: underline;
color: blue;
}
XML example:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="test20031207.css"?>
<para>
This is text followed by a simple XLink
<mylink xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:show="replace"
xlink:href="http://javascript.faqts.com/">JavaScript.FAQTs</mylink>
</para>
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4

P: n/a
Thanks. I tried the XLink a couple of times, and went "huh?" when it
didn't work.

Now, I'm going to go scream at Microblow.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.