3 Replies - 764 Views - Last Post: 26 September 2012 - 03:05 PM

#1 hugoriffic  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 185
  • Joined: 16-September 09

XML Question

Posted 24 September 2012 - 02:32 PM

For an intro to XML class I set up a website that links to an xml document online. At school the code worked. I had a few things left to do to my code to finish the project and when I got home the site no longer works properly. Could someone take a look at my code and see if everything is fine? Like I said it worked at school.
Here is the website: http://itweb.fvtc.ed...ebRecordSet.htm
Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Welcome to SkyWeb</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <xml id="skyWeb" src="http://deptcis2.fvtc.edu/$xml/skyweb/skyweb.xml"></xml>
</head>
    
           
<body background="http://deptcis2.fvtc.edu/$xml/skyweb/space.jpg" text="white">

         <div id="pageTitle" datasrc="#http://deptcis2.fvtc.edu/$xml/skyweb/skyweb.xml" datafld="title">Welcome to SkyWeb</div>

         <table>
            <tr>
                <td colspan="5" style="text-align: center">
                   <button onclick="skyWeb.recordset.moveFirst()">
                      |&lt; First
                   </button>
                   <button onclick="skyWeb.recordset.movePrevious(); if (skyWeb.recordset.BOF) skyWeb.recordset.moveLast()">
                      &lt; Back
                   </button>
                   <button onclick="skyWeb.recordset.movePrevious(); if (skyWeb.recordset.BOF) skyWeb.recordset.moveFirst()">
                      Forward &gt;
                   </button>
                   <button onclick="skyWeb.recordset.moveLast()">
                      Last &gt;|
                   </button>
                </td>
             </tr>
             <tr><td rowspan="5" style="text-align: center; width: 250px">
                   <img datasrc="#skyWeb" datafld="photo" alt="" />
                 </td>
                 <th></th>
                 <td id="name">
                   <span datasrc="#skyWeb" datafld="name"></span>
                 </td>
             </tr>
             <tr>
                 <th></th>
                 <td>
                   <span datasrc="#skyWeb" datafld="description"></span>
                 </td>
             </tr>
             <tr>
                 <th></th>
                 <td>
                   <span datasrc="#skyWeb" datafld="nbr"></span>
                 </td>
             </tr>
          </table>

</body>
</html>




Is This A Good Question/Topic? 0
  • +

Replies To: XML Question

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,661
  • Joined: 23-August 08

Re: XML Question

Posted 24 September 2012 - 02:54 PM

http://deptcis2.fvtc...yweb/skyweb.xml

Is $xml an actual directory name on the web server?

EDIT: Actually, yeah, if I click on that link I get the XML. Hmmm.

EDIT 2: The xml tag seems to be an IE-only tag. That's bad.
Was This Post Helpful? 0
  • +
  • -

#3 hugoriffic  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 185
  • Joined: 16-September 09

Re: XML Question

Posted 25 September 2012 - 07:48 AM

Fixed all the issues. Everything is now working properly. Now I have a new question. How do you add an alert or message box to an onclick event only if something specific happens without using javascript??

What I mean is from my "Back" button if I have reached the first file I need to move to the last file (I've done this), but I also need to then display an alert or message box that states you've now landed on the last record. And the reverse for the "Forward" button.

I've tried these: alert("message"), MsgBox("message"), and message("message"). None of these work.

Here is the code I am referring to:
 <button onclick="skyWeb.recordset.movePrevious(); if (skyWeb.recordset.BOF) skyWeb.recordset.moveLast()">
                      &lt; Back
 </button>
 <button onclick="skyWeb.recordset.movePrevious(); if (skyWeb.recordset.BOF) skyWeb.recordset.moveFirst()">
                      Forward &gt;
 </button>


Was This Post Helpful? 0
  • +
  • -

#4 hugoriffic  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 185
  • Joined: 16-September 09

Re: XML Question

Posted 26 September 2012 - 03:05 PM

Does anyone have any idea as to how to add a message box or alert box at the end of the onclick event? I've also tried this:

<button onclick="skyWeb.recordset.movePrevious(); if (skyWeb.recordset.BOF) skyWeb.recordset.moveLast(); javascript=alert('You have reached the end of file')">
2	                     &lt; Back
3	</button>



Didn't work
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1