I collect watches. Three kinds: vintage mechanical, military and quartz. I want to migrate from my existing HTML/CSS to XML/XLS, the purpose being to separate data from mark-up. The plan was to have 3 plain XML data files, each referring to a single, common XLS file. Part of the XML data includes a number of description elements <LDESC>blah blah blah</LDESC>. Sometimes my blah contains HTML-style links <a href=etc etc, sometimes not. When it does, not unsurprisingly, the links appear in the browser as literal text .
I have read but not really understood reams of info on XSLT, XLINK, namespaces, but to no avail. All I want is the links to appear in the output as links. Googling this problem produces several hits but no understandable reasons or solutions.
Here's the two files as they stand, including an unsuccessful attempt at declaring a namespace in the first LDESC in the XML data file.
Thank you very much, John. It worked like a charm (after I turned the left brackets in that one item back into < ). I was just about to give up and revert to HTML but now I'm much encouraged by both this forum and it's knowledgeable members.
That little problem with Firefox. Oddly, MSIE gets HTML and CSS pretty much wrong but it tends to be dead on with XML and XSL. I ran into something like this before and if my memory is correct the XSLT-FO spec allows that "disable-output-escaping" doesn't have to be supported when the result is a fragment. The good folks working on Firefox decided to call all their output fragmensts and so did away with this, most useful, feature.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
I'll give it a shot later, I'm a little burned out right now
Here's the result . . .
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="dev.xsl"?>
This is the most amazing <a href="www.huguenin.com">Huguenin</a> watch.
Ah, now I see . . the copy should be faithfully copied to the output as-is without interference from the browser's parser. Indeed, it worked locally on xmlSpy's browser but FireFox still would not have it, neither off- nor on-line.
After going down many trails involving namespaces and even Xlink, I've ended up with this (a sort of browser written in xsl ). So now links come out OK in IE and FF off- and on-line.
<xsl:when test="name()='a'"><!-- when the name of the current node is 'a' then create a link with the values of the current element's attribute and text -->
<!-- else output the current node's text -->