473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using CSS to make XML links

One can (leaving aside for now if one should) use CSS to make an XML
document render is some sort of eye-friendly way. Supposing this XML
contained elements which one would like to have be treated as hyper
links in the browser.

For example, the document
http://www.aboyandhiscomputer.com/blog_rss2.xml contains elements of
the form: <link>url-goes-here</link> in it. Now, obviously, you can
use CSS to (visually) format "link"s as one sees fit. But is there
anyway to tell the browser that the content of the link container
really IS a link and it would be oh so swell if it treated it
something akin to <a href="url-goes-here">url-goes-here</a>?

Thanks,
John
Jul 21 '05 #1
4 1834
John Hascall <jo**@iastate.edu>:

<link>url-goes-here</link> (...) is there anyway to tell the browser
that the content of the link container really IS a link and it would be
oh so swell if it treated it something akin to <a
href="url-goes-here">url-goes-here</a>?


Not in official CSS and neither in the public drafts AFAIR (most of the
W3C seems to prefer HLink or XLink), but Opera 7 proprietarily supports
something like this: <http://www.opera.com/docs/specs/#xml-css-link>. The
URI has to be taken from an attribute, not the element content. That's
usually the best design decision anyway.

If not hardcoded, Opera's internal XHTML stylesheet would probably have
something like this:

a[href] {-o-link: attr(href); -o-link-source: current;}
img[src] {-o-replace: attr(src);}

I don't know whether the respective pseudo-classes :link and :visited will
correctly work with this.

I think this vendor-specific approach is pretty straight forward, although
probably leaving the original scope of CSS.

--
Marvin: "It gives me a headache just trying to think down to your level."

(The Hitchhiker's Guide to the Galaxy)
Jul 21 '05 #2


John Hascall wrote:

For example, the document
http://www.aboyandhiscomputer.com/blog_rss2.xml contains elements of
the form: <link>url-goes-here</link> in it. Now, obviously, you can
use CSS to (visually) format "link"s as one sees fit. But is there
anyway to tell the browser that the content of the link container
really IS a link and it would be oh so swell if it treated it
something akin to <a href="url-goes-here">url-goes-here</a>?


You can use XLinks for Mozilla:
<link xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="url-goes-here"
xlink:type="simple">url-goes-here</link>
Not a CSS solution obviously but whether something is a link or not is
not a question of presentation but of semantics.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 21 '05 #3
Martin Honnen <ma*******@yahoo.de>:

whether something is a link or not is not a question of presentation but
of semantics.


Yes, and as such it should be able to be described in a good "document
type description language" (like IDs). XML DTDs don't provide such a basic
feature AFAIK, so they came up with XLink which clutters the source due to
its namespace alone.

--
Reality is an illusion that occurs due to the lack of alcohol.
Jul 21 '05 #4
Martin Honnen <ma*******@yahoo.de> wrote in message news:<41***********************@newsread4.arcor-online.net>...
John Hascall wrote:

For example, the document
http://www.aboyandhiscomputer.com/blog_rss2.xml contains elements of
the form: <link>url-goes-here</link> in it. Now, obviously, you can
use CSS to (visually) format "link"s as one sees fit. But is there
anyway to tell the browser that the content of the link container
really IS a link and it would be oh so swell if it treated it
something akin to <a href="url-goes-here">url-goes-here</a>?


You can use XLinks for Mozilla:
<link xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="url-goes-here"
xlink:type="simple">url-goes-here</link>
Not a CSS solution obviously but whether something is a link or not is
not a question of presentation but of semantics.


Thanks. That looks perfectly horrid, but thanks for the pointer.

John
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Dafydd | last post by:
I have the following Script in my web page reduce to two pages. <script> function details() { document.getElementById('details').style.visibility='visible';...
14
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the...
5
by: dananrg | last post by:
I've created a small company database where the tables reside in a SQL Server database. I'm using Access 2000 forms for a front end. I've got a System DSN set-up to SQL Server and am using links...
1
by: jon | last post by:
I would like to use the variable that the javascript creates as it parses the URL and be able to use this variable in other links on the same page. notice how link to page 2 has the token but the...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
9
by: chrisspencer02 | last post by:
I am looking for a method to extract the links embedded within the Javascript in a web page: an ActiveX component, or example code in C++/Pascal/etc. I am looking for a general solution, not one...
6
by: ivan.leben | last post by:
I want to write a Mesh class using half-edges. This class uses three other classes: Vertex, HalfEdge and Face. These classes should be linked properly in the process of building up the mesh by...
4
by: sirumalla.srinivas | last post by:
Hi, I have link to the various documents which is stored on the server. When ever user click on any link, the respective document should be opened. Here what i need is to have all the links on...
1
by: Elitephoto | last post by:
How to make horizontal menu using .js and .css files. I only need 5 links. I am new to this and have tried everything I can but was not able to do this. Can someone please write two separate...
9
by: christopher_board | last post by:
Hi all. I am trying to connect to a MySQL Database using PHP on a local machine using locahost. I am using the following code <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.