XLink to other sites?

Discussion in 'XML' started by eagle0Nine, Dec 6, 2003.

  1. eagle0Nine

    eagle0Nine Guest

    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.
     
    eagle0Nine, Dec 6, 2003
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Dec 6, 2003
    #2
    1. Advertising

  3. 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!
     
    Chris Barajas, Dec 6, 2003
    #3
  4. 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/
     
    Martin Honnen, Dec 7, 2003
    #4
  5. 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!
     
    Chris Barajas, Dec 7, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Buchan
    Replies:
    1
    Views:
    490
    Eric Lawrence [MSFT]
    Feb 20, 2004
  2. Stefan Caliandro
    Replies:
    2
    Views:
    648
    Beauregard T. Shagnasty
    Feb 14, 2005
  3. Jasbird

    Sites about web-sites ?

    Jasbird, Sep 12, 2006, in forum: HTML
    Replies:
    1
    Views:
    409
  4. imx
    Replies:
    10
    Views:
    823
  5. Yitzak

    2 sites or not 2 sites

    Yitzak, Mar 7, 2009, in forum: ASP .Net
    Replies:
    5
    Views:
    448
    Andrew Morton
    Mar 10, 2009
Loading...

Share This Page