Discussion Locked

Hyperlinks from XML/XSLT and MSIE

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Does anyone know if it's possible to run XSLT on an XML file directly in MSIE so that it inserts working HTML-style links? In other words, I'm hoping to have MSIE do the insertions rather than run the XML through another program like Saxon, and I'm interested in just getting a plain old regular HTML doc with working hyperlinks in it as the result.

I'm hoping to hear how possible this is before I spend a lot of time experimenting with it (my XML doesn't always come out perfect at first whack).

Right now I think I understand some of the basics of declaring and using the HTML namespace in an XML document; maybe all I need is just a simple example to get me started.

thanks

4 replies

by peter ritchie

IE supports XML and XSLT documents directly. If you write your XML and XSLT correctly you'll get the output you're looking for.
For example, viewing xml.xml with IE will show the HREF fields as HTML links with the given XSLT file.

xml.xml:

PeterRitchie.com
Home of Peter Ritchie Inc.
http://www.peterritchie.com/

xslt.xsl:

by peter ritchie

As a follow up; with XML/XSLT there are many, many ways to skin a cat. I've only shown one way. For example, instead of using just elements the data could have a mix of elements and attributes:

Depending on how you've structured your XML the XSLT will have to be modified.

I won't go into the age-old discussion on whether/where to use attributes; I'll just assume you'll make you choice based on your own priorities.

by cres

The options for rating the questions don't seem to leave many options; however, Peter Ritchie's answer worked when I tried his example in MSIE.

I'm wondering though, does Netscape 6 support XSLT? The example didn't work in N6, so I'm guessing itdoesn't. Also, I tried searching on the Web to find out more about Netscape support for XSLT, but couldn't find anything very definitive about it in the time I spent. Most of what I found seemed to hint that N6 doesn't support XSLT yet. I guess I should post another Q&A about that one.

This discussion is closed to new replies.