XLink within XHTML

E

Erik Jälevik

Is it possible to use XLink within an XHTML document?

I am trying the following in Mozilla Firebird 0.7 (which supposedly supports
XLink) and I don't get a link:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xl="http://www.w3.org/1999/xlink">
<body>
<p xl:type='simple'
xl:href='http://www.google.com'
xl:show='replace'
xl:actuate='onRequest'>
Link test
</p>
</body>
</html>

Am I getting something wrong here? The linking works from a pure xml
document.

Btw, the only reason I'm not using <a href>s is that it's for a university
assignment and we're specifically forbidden to use HTML links...

Thanks,
Erik
 
M

Martin Honnen

Erik said:
Is it possible to use XLink within an XHTML document?

I am trying the following in Mozilla Firebird 0.7 (which supposedly supports
XLink) and I don't get a link:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xl="http://www.w3.org/1999/xlink">
<body>
<p xl:type='simple'
xl:href='http://www.google.com'
xl:show='replace'
xl:actuate='onRequest'>
Link test
</p>
</body>
</html>

Am I getting something wrong here? The linking works from a pure xml
document.

How do you serve the document to Mozilla? I guess it can't work if you
serve it as text/html but if you serve it as text/xml then it could work.
 
E

Erik Jälevik

Martin Honnen said:
How do you serve the document to Mozilla? I guess it can't work if you
serve it as text/html but if you serve it as text/xml then it could work.

Hmm, I'm just trying it out locally at the moment. The file has extension
xml so Mozilla should assume it's being "served" as text/xml. I'll try and
upload it to the web server though to see if the link works.

Thanks,
Erik
 
E

Erik Jälevik

Nope, even from the web server, "Link test" just shows up as normal text.

Erik
 
M

Martin Honnen

Erik said:
Nope, even from the web server, "Link test" just shows up as normal text.

The following XLink works for me with Netscape 7.1:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:myElements="http://whatever"
xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>simple XLinks</title>
</head>
<body>
<p>
<myElements:myLink xlink:type="simple"
xlink:href="http://www.kibo.com/"
xlink:show="replace"
xlink:actuate="user">Visit GOD</myElements:myLink>
</p>
</body>
</html>

I am not sure applying xlink attributes to standard XHTML elements is
supposed to work.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top