xml and linking help please

Discussion in 'XML' started by Mike, Sep 24, 2003.

  1. Mike

    Mike Guest

    I need to have some links within an xml document to external pages. I
    have tried with the below xml and xsl documents(the proposed link has
    a tag called link under paragraph):

    XML:
    ----------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="rates.xsl"?>
    <rates>
    <pagetitle>Rates 2003/2004</pagetitle>
    <group>
    <content>
    <paragraph>
    These rates do not contain cleaning/maintenance fees
    ($100) or the 11.5% Florida Sales Tax.
    </paragraph>
    <paragraph>
    Minimum Rental (3)Nights.
    </paragraph>
    <paragraph>
    No Pets/No Smoking Allowed.
    </paragraph>
    <paragraph>
    Rates subject to
    <link
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xlink:type="simple"
    xlink:href="http://www.cnn.com">
    change
    </link>
    without notification.
    </paragraph> <paragraph>
    Security deposit of $200 is required to hold
    reservation &amp; is returned within 2 weeks
    of departure.
    </paragraph>
    </content>
    <ratetable>
    <tableheaderseason>Season</tableheaderseason>
    <tableheaderdaily>Daily</tableheaderdaily>
    <tableheaderweekly>Weekly(Sat-Sat)</tableheaderweekly>
    <tableheadermonthly>Monthly</tableheadermonthly>
    <seasonalrows>
    <rowseason>Fall</rowseason>
    <rowdates>9/6 - 10/24/03</rowdates>
    <rowdaily>$159</rowdaily>
    <rowweekly>$963</rowweekly>
    <rowmonthly>Inquire</rowmonthly>
    </seasonalrows>
    <seasonalrows>
    <rowseason>Winter</rowseason>
    <rowdates>10/25 - 2/28/04</rowdates>
    <rowdaily>$129</rowdaily>
    <rowweekly>$783</rowweekly>
    <rowmonthly>Inquire</rowmonthly>
    </seasonalrows>
    </ratetable>
    </group>
    </rates>


    XSL:
    --------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
    <html>
    <head>
    <title><xsl:value-of select="rates/pagetitle" /> -
    kscarrollproperties.com</title>
    <meta http-equiv="content-type" content="text/html;
    charset=iso-8859-1" />
    <meta content="MSHTML 6.00.2800.1226" name="GENERATOR" />
    <link media="all" href="global.css" type="text/css" rel="stylesheet"
    />
    <style type="text/css" media="all">@import url(global_p.css);</style>
    <script language="javascript"><!--
    function show(object) {
    if (document.getElementById) {
    document.getElementById(object).style.visibility = 'visible';
    }
    else if (document.layers && document.layers[object]) {
    document.layers[object].visibility = 'visible';
    }
    else if (document.all) {
    document.all[object].style.visibility = 'visible';
    }
    }

    function hide(object) {
    if (document.getElementById) {
    document.getElementById(object).style.visibility = 'hidden';
    }
    else if (document.layers && document.layers[object]) {
    document.layers[object].visibility = 'hidden';
    }
    else if (document.all) {
    document.all[object].style.visibility = 'hidden';
    }
    }
    //-->
    </script>
    </head>
    <body>
    <div id="setwidth">
    <div id="right2column">
    <div id="left"></div>
    <div class="leftsiderates">
    <h1><xsl:value-of select="rates/pagetitle" /></h1>
    <xsl:for-each select="rates/group/content/paragraph">
    <p><xsl:value-of select="." /></p>
    </xsl:for-each>
    </div>
    <div class="rightsiderates">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
    <td class="rowHead"><xsl:value-of
    select="rates/group/ratetable/tableheaderseason" /></td>
    <td class="rowHead"><xsl:value-of
    select="rates/group/ratetable/tableheaderdaily" /></td>
    <td class="rowHead"><xsl:value-of
    select="rates/group/ratetable/tableheaderweekly" /></td>
    <td class="rowHead"><xsl:value-of
    select="rates/group/ratetable/tableheadermonthly" /></td>
    </tr>
    <tr>
    <td colspan="4" class="rowSubHead">View <a
    href="#">availability</a> or <a href="contact.htm">contact us</a> to
    reserve your dates.</td>
    </tr>
    <xsl:for-each select="rates/group/ratetable/seasonalrows">
    <tr>
    <td class="row1"><span class="dkbluetext"><xsl:value-of
    select="rowseason" /></span></td>
    <td class="row1r"><xsl:value-of select="rowdaily" /></td>
    <td class="row1r"><xsl:value-of select="rowweekly" /></td>
    <td class="row1"><a href="contact.htm"><xsl:value-of
    select="rowmonthly" /></a></td>
    </tr>
    </xsl:for-each>
    </table>
    </div>
    <br clear="all" /><br clear="all" />
    </div>
    </div>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>


    I appreciate any help
    Mike, Sep 24, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay
    Replies:
    2
    Views:
    612
  2. Replies:
    4
    Views:
    484
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    497
    Big Brian
    Oct 14, 2003
  4. Chiller

    Linking problem - please help

    Chiller, Apr 9, 2004, in forum: C++
    Replies:
    6
    Views:
    421
    Karl Heinz Buchegger
    Apr 9, 2004
  5. idev
    Replies:
    6
    Views:
    407
Loading...

Share This Page