Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    xml data feed to html??

    I'm totally new to XML. I have a vendor that sent me a link to a page that has this as the source. The page has an xsl extension. All I want to do is put the values below into my existing html to display our delayed stock quit. I've been searching the web for 3 days and can't find anything that seems to work.

    Can anyone help?

    <RECORDS>
    <RECORD SRC="ILXPT" INST="ABC">
    <FLD F="PRIMARY_MKT_NAME" V="NYSE"></FLD>
    <FLD F="PER_CHANGE" V="0.15"></FLD>
    <FLD F="LAST_TR_HOUR" V="11"></FLD>
    <FLD F="LAST_TR_MINUTE" V="21"></FLD>
    <FLD F="HIGH" V="32.92"></FLD>
    <FLD F="ANNLOW" V="25.1"></FLD>
    <FLD F="CLOSE" V="32.75"></FLD>
    <FLD F="LOW" V="32.4"></FLD>
    <FLD F="CHANGE" V="0.05"></FLD>
    <FLD F="OPEN" V="32.75"></FLD>
    <FLD F="SYMBOL" V="MYL"></FLD>
    <FLD F="ANNHIGH" V="38.12"></FLD>
    <FLD F="VOLUME" V="146600"></FLD>
    <FLD F="LAST" V="32.8"></FLD>
    <PressWebServiceDiagnostics V="Press Machine: HORN, Press Sources: ILXPT:BLANCO(10.10.104.155);REX(10.10.104.155)"></PressWebServiceDiagnostics>
    <IsError V="False"></IsError>
    </RECORD>
    <IsError V="False"></IsError>
    </RECORDS>

  • #2
    New Coder
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure where this will get you, but you can have an <XML> tag in your HTML that references the server page directly


    Example
    <XML id="myXMLdata" src="http://www.vendorweb.com/stocks.xml"></xml>

    I'm guessing that you'll probably want to load the XML and then parse out the data you want. To do this, you'll either have to use Java to load that page off the server and parse the data out, then insert what you want back into the document through the DOM

    -or-

    use XML Data Islands and XSL Transformations

    You can read more about XML Data Islands on Microsoft's MSDN On-line, and they provide some great examples.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    from what I know, XML data islands are IE propriety only.
    'If you don't stand for something, you'll fall for anything.'

  • #4
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That what I see also. I must maintain compatibility with Netscape also. Any ideas?

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i'm a few days old at XML myself
    but i think u cud do it using server-side script, like asp or php, if u're using it ...
    'If you don't stand for something, you'll fall for anything.'

  • #6
    New Coder
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's a script that will load an XML file for either IE or NS

    <script>
    var xmlDoc;
    function init () {
    if (document.all && document.getElementById) {
    xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
    xmlDoc.async = false;
    xmlDoc.load("http://www.vendorweb.com//test123.xml");
    showXML();
    }
    else if (document.implementation &&
    document.implementation.createDocument) {
    xmlDoc = document.implementation.createDocument('', '', null);
    xmlDoc.addEventListener('load', showXML, false);
    xmlDoc.load("http://www.vendorweb.com//test123.xml");
    }
    }
    function showXML () {
    var nodes = xmlDoc.documentElement.childNodes;
    document.getElementById('to').appendChild(
    document.createTextNode(nodes.item(0).firstChild.nodeValue)
    );
    document.getElementById('from').appendChild(
    document.createTextNode(nodes.item(1).firstChild.nodeValue)
    );
    document.getElementById('header').appendChild(
    document.createTextNode(nodes.item(2).firstChild.nodeValue)
    );
    document.getElementById('body').appendChild(
    document.createTextNode(nodes.item(3).firstChild.nodeValue)
    );
    }
    </script>

    It's not my code - but I'm sure you can figure it out, didn't look too difficult.


  •  

    Posting Permissions

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