Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Newby - XML data doesn't display in html page.

Evil8 (MIS) (OP)
8 Dec 11 15:43
Hello,

I'm new to using XML data. Our office has a website with a page that displays Community Meetings. Currently this page is static and needs to be updated by hand monthly. To make this more efficant I've databased the meetings in Access 2010 and exported the information to XML.

I have the page created but all I get is the table header and one row of blank cells.

So far the code looks like:

CODE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:od="urn:schemas-microsoft-com:officedata">
<head>
<title>Community Meetings</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<script>
    function ld_meet()
    {
    var doc=nb_meet.XMLDocument;
    doc.load("meetingsbycity.xml");
    document.getElementById("head_id").innerHTML="Meetings By City ";
    }
</script>

<xml id="nb_meet" src="meetingsbycity.xml"></xml>
<object id="nb_meet"
    CLASSID="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39"
    width="0" height="0"></object>

<body>

<table width="80%" datasrc="#nb_meet" border="1" align="center" bordercolor="#FFFFFF">
    <caption>
  <span><strong><font color="#990000" size="6">Meetings By City</font></strong></span>
  </caption>
    <thead>
        <tr>
            <th>City</span></th>
            <th>State</span></th>
            <th>Date</span></th>
            <th>Time</span></th>
            <th>Place</span></th>
            <th>Address</span></th>
        </tr>
    </thead>
     <tbody>
        <tr>
            <td><span datafld="city"> </span></td>
            <td><span datafld="state"> </span></td>
            <td><span datafld="edate"> </span></td>
            <td><span datafld="etime"> </span></td>
            <td><span datafld="place"> </span></td>
            <td><span datafld="address"> </span></td>
        </tr>
     </tbody>
 </table>

</body>
</html>

Here is a sample of the XML page meetingsbycity.xml

CODE

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="xml_style.css"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2011-11-28T12:34:22">
<Meetings>
    <qry_meetings>
        <ID>1</ID>
        <edate>2011-10-06T00:00:00</edate>
        <etime>1899-12-30T11:00:00</etime>
        <name>AmericInn</name>
        <address>3009 Lakeshore Drive East</address>
        <city>Ashland</city>
        <state>WI</state>
    </qry_meetings>
    <qry_meetings>
        <ID>2</ID>
        <edate>2011-11-03T00:00:00</edate>
        <etime>1899-12-30T11:00:00</etime>
        <name>AmericInn</name>
        <address>3009 Lakeshore Drive East</address>
        <city>Ashland</city>
        <state>WI</state>
    </qry_meetings>
    <qry_meetings>
        <ID>3</ID>
        <edate>2011-12-01T00:00:00</edate>
        <etime>1899-12-30T11:00:00</etime>
        <name>AmericInn</name>
        <address>3009 Lakeshore Drive East</address>
        <city>Ashland</city>
        <state>WI</state>
    </qry_meetings>
</Meetings>
</dataroot>

I'm not sure what I'm doing wrong. I don't think I'm too far off, but I'm stuck. Can anyone help? Where does the CLASSID come from? I got the one I'm using from an example.

Thanks!
Evil8 (MIS) (OP)
9 Dec 11 10:53
I got data! I simplified the DSO Function on the html page and removed the style and dataroot tags from XML page. The html code looks like this:

CODE

<html>
<head>
<title>Community Meetings</title>

<script language="JavaScript">
    function load()
    {
    var xmlDso=myXML.XMLDocument;
    xmlDso.load("meetingsbycity.xml");
    }
</script>

</head>
<body bgcolor="#FFFFFF" onLoad="load()">

<object id="myXML" CLASSID="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39"    width="0" height="0"></object>

<table datasrc="#myXML" border="1" width="100%">
    <caption>
        <span><strong><font color="#990000" size="6">Meetings By City</font></strong></span>
     </caption>
    <thead>
        <tr>
            <th>City</span></th>
            <th>State</span></th>
            <th>Date</span></th>
            <th>Time</span></th>
            <th>Place</span></th>
            <th>Address</span></th>
        </tr>
    </thead>
         <tr>
            <td><span datafld="city"> </span></td>
            <td><span datafld="state"> </span></td>
            <td><span datafld="edate"> </span></td>
            <td><span datafld="etime"> </span></td>
            <td><span datafld="name"> </span></td>
            <td><span datafld="address"> </span></td>
        </tr>
  </table>

</body>
</html>

Now I'll try to do better formatting on html page. I want to have the data in colums down and right but look like:

name
edate - etime
address
city, state

I wonder if I can also have the user choose a different XML page to load by button?

Happy coding!

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close