SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Member
    Join Date
    May 2002
    0 Post(s)
    0 Thread(s)

    Question Making attribute values from XML data in XSL

    Nevermind, I got it to work. IE 6 was refusing to download the new stylesheet, even when prompted to do so. That's a strange quirk ... anyone else have this problem? By the way, I simply forgot to close an empty tag.

    I scoured the article here and several others, and I still get errors when I try to make attribute values from my XML data using XSL. I'm trying to make a link from a piece of data called "link" and I want the link text to be "title". Below is my XSL stylesheet.

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:output method="html" />
    <xsl:template match="/rss/channel">
    <title> | rss</title>
    <style type="text/css">@import url("/x.css");</style>
    <div id="main">
    <h4><strong><xsl:value-of select="title" /></strong> - <xsl:value-of select="description" /></h4>
    <xsl:apply-templates select="item" />
    <xsl:template match="item">
    <hr />
    <xsl:attribute name="href">
    <xsl:value-of select="link" />
    <xsl:value-of select="title" />
    <p><xsl:value-of select="description" /></p>
    Last edited by stevenhasty; May 30, 2002 at 10:47.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts