Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    6
    Member #
    6191
    thanks in advance

  2.  

  3. #2
    Senior Member jlgosse's Avatar
    Join Date
    Jan 2004
    Location
    Newfoundland, Canada
    Posts
    1,037
    Member #
    4570
    Liked
    7 times
    Can you better explain what you mean please?


  4. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    6
    Member #
    6191
    A group of us are updating a fan site for the Hollywood stock exchange. This lists movies and actors, etc. They have an XML feed with the live prices of the stocks we want to pull that feed into a MySQL database and when use the data to do things like putting live prices of stocks on pages.

  5. #4
    Senior Member zionlocke's Avatar
    Join Date
    Jan 2003
    Location
    .: l33t Basement :.
    Posts
    736
    Member #
    483
    Liked
    3 times
    An easier solution is to pull the information striaght from the xml feed to the page. It is a waste of time to move the information to a db before displaying it. Also, find out how often the xml file is updated. I worked on one that was updated every thirty seconds. So, I set the page to refresh itself every thirty seconds. I'll be making a flash version of that same project very soon. I'm pretty sure with flash I'll be able to reload the xml file and not need to refresh.

    I hope that helps. It is definitely possible to store xml into a db, but I don't think you need to if you want live stats.
    Cheers, zionlocke :chinese:
    Links: Zion Creation | Blog

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    XML -> DB = DOM (Document Object Mode)
    XML -> HTML = XSL-T + Sablotron (assuming you're using PHP)

  7. #6
    Junior Member
    Join Date
    Jun 2004
    Location
    Berkeley, CA
    Posts
    1
    Member #
    6345
    transio,

    When you say:
    "XML -> DB = DOM (Document Object Mode)"

    Can you explain or provide and example of DOM in PHP?

  8. #7
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,656
    Member #
    1234
    Liked
    137 times
    Karl, PLEASE keep us updates on the site, as I've been a member of HSX for 7 years.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Quote Originally Posted by prospero9000
    Can you explain or provide and example of DOM in PHP?
    Here's a snippet from PHP.net (Full PHP DOM XML reference):
    PHP Code:
    <?php

    function PrintDomTree($DomNode)
    {
       if (
    $ChildDomNode $DomNode->first_child()) {
           static 
    $depth 0;

           
    $whitespace "\n<br>".str_repeat("&nbsp;", ($depth 2));

           while (
    $ChildDomNode) {
               if (
    $ChildDomNode->node_type() == XML_TEXT_NODE) {
                   echo 
    trim($ChildDomNode->node_value());
               } elseif (
    $ChildDomNode->node_type() == XML_ELEMENT_NODE) {
                   
    $HasTag 1;
                   echo 
    $whitespace;
                   echo 
    "&lt;"$ChildDomNode->node_name();

                   if (
    $ChildDomNode->has_attributes()) {
                       
    $Array $ChildDomNode->attributes();
                       foreach (
    $Array AS $DomAttribute) {
                           echo 
    " "$DomAttribute->name(), "=\""$DomAttribute->value(), "\"";
                       }
                   }
                   echo 
    "&gt;";

                   if (
    $ChildDomNode->has_child_nodes()) {
                       
    $depth++;
                       if (
    PrintDomTree($ChildDomNode)) {
                           echo 
    $whitespace;
                       }
                       
    $depth--;
                   }
                   echo 
    "&lt;/"$ChildDomNode->node_name(), "&gt;";
               }
               
    $ChildDomNode $ChildDomNode->next_sibling();
           }
           return 
    $HasTag;
       }
    }

    ?>

  10. #9
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    However, as zionlocke said earlier, you'd be better off outputting the XML feed directly to your page using XSL-T or DOM.


Remove Ads

Posting Permissions

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

Search tags for this page

how to fed in to the data base from an html

,

how to import xml into mysql live feed

,

how to pull live datafeed from a website

,

how to pull xml feed

,

import xml feed into mysql database

,

importar xml a mysql php

,

live xml feed

,

pulling xml feeds to mysql

,

storing xml feed to mysql

Click on a term to search for related topics.
All times are GMT -6. The time now is 11:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com