xml linking

Discussion in 'XML' started by Mike, Sep 23, 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 23, 2003
    #1
    1. Advertising

  2. Mike

    Mike Guest

    sorry, I posted this here in error, I've created it's own posting now.

    Sorry

    (Mike) wrote in message news:<>...
    > 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
    #2
    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. Mike
    Replies:
    0
    Views:
    353
  2. perturbed

    linking XML docs

    perturbed, Oct 16, 2003, in forum: XML
    Replies:
    1
    Views:
    363
    Kimanzi Mati
    Oct 16, 2003
  3. UndoMiel
    Replies:
    1
    Views:
    416
    Keith M. Corbett
    Sep 21, 2004
  4. Sneamia

    Linking with xml content

    Sneamia, Jun 2, 2006, in forum: XML
    Replies:
    2
    Views:
    397
    Sneamia
    Jun 3, 2006
  5. Erik Wasser
    Replies:
    5
    Views:
    465
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page