XML DOM


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: XML DOM

  1. #1
    Holly Guest

    XML DOM


    Okay so I am really new to this whole xml thing,
    and I'm the only one at work with any experience with it.
    So any help would be greatly appreciated

    Anyway, so I have this xml file that I am putting into a table via javascript.
    I have it stored on a disk, and it runs fine from the disk, but when I put
    it onto the system, it doesn't print anything out!!! Is this possibly because
    somewhere along the line I downloaded the xml dom onto my disk, and our system
    just doesn't have the xml dom?? Or is the xml dom part of the browser?
    If
    I need to download one, where should I go??

    Also, does Netscape work at all with XML??? I can't seem to get anything
    to
    work on Netscape???

    Sorry if I sound silly, just trying to understand this whole new world of
    xml!!!
    Thanks for your help.

  2. #2
    MarkN Guest

    Re: XML DOM


    "xml file" = an xml document stored in a file maybe with and .xml extension.

    "putting into a table via javascript" - How?

    "I have it stored on a disk" - that is a file
    "when I put it onto the system" - What do you mean?
    "it doesn't print anything out" - To your printer? Do you mean it doesn't
    display in the browser?

    >Is this possibly because
    >somewhere along the line I downloaded the xml dom onto my disk


    Could be.
    >, and our system
    >just doesn't have the xml dom??

    Could be.

    >Or is the xml dom part of the browser?

    Could be.

    >Also, does Netscape work at all with XML???

    Yes.

    >I can't seem to get anything
    >to
    >work on Netscape???

    Version????

    Ok, XML is just a data definition language. It is much like HTML, in fact
    well formed HTML IS valid XML. So if you don't tell your browser that the
    XML is XML it probably thinks it is HTML. Since the XML probably doesn't
    include display info the browser IS showing the XML but it is hidden. Try
    viewing the page source in the browser. For browser to parse the xml it
    needs to know that it is XML. Browsers do different things based on this
    knowledge because of conceptual differences.

    Mark

  3. #3
    Holly Guest

    Re: XML DOM



    >
    >"xml file" = an xml document stored in a file maybe with and .xml extension.

    yes, it is an xml document with an .xml file extension and only contains
    the data in proper xml format. But in addition to that I have a file with
    a .html file extension that contains all of the javascript and HTML for displaying
    the data.


    >"putting into a table via javascript" - How?


    I have var bmgtXML = new ActiveXObject( "Microsoft.XMLDOM" );
    bmgtXML.async = false;
    bmgtXML.load( "EcOsBMGTGroup.xml" ); with a fully specified path to the
    xml file.

    Then using javascript functions am able to display on IE6 the table I want.


    >
    >"I have it stored on a disk" - that is a file

    yes

    >"when I put it onto the system" - What do you mean?

    when I place the file onto our unix based system, which is where all of our
    files run from.

    >"it doesn't print anything out" - To your printer? Do you mean it doesn't
    >display in the browser?

    yes

    >
    >>Is this possibly because
    >>somewhere along the line I downloaded the xml dom onto my disk

    >
    >Could be.

    Wouldn't there then be a file name for it somewhere on the disk??

    >>, and our system
    >>just doesn't have the xml dom??

    >Could be.

    Where can I find one, if we don't have one?


    >
    >>Or is the xml dom part of the browser?

    >Could be.

    I think it is for IE 6

    >Ok, XML is just a data definition language. It is much like HTML, in fact
    >well formed HTML IS valid XML. So if you don't tell your browser that the
    >XML is XML it probably thinks it is HTML. Since the XML probably doesn't
    >include display info the browser IS showing the XML but it is hidden. Try
    >viewing the page source in the browser. For browser to parse the xml it
    >needs to know that it is XML. Browsers do different things based on this
    >knowledge because of conceptual differences.


    How can I tell the browser that it is xml? Or am I already doing this?


    Thanks
    ~Holly


  4. #4
    MarkN Guest

    Re: XML DOM


    You didn't tell me how, after you loaded the xml object, you put the 'xml'
    in the table with javascript.

    I don't think you downloaded the 'DOM' or the xml file. What ever you did
    probably happened server-side and all you got was HTML. Where is this code
    running - "var bmgtXML = new ActiveXObject( "Microsoft.XMLDOM" );" If the
    script didn't error off and the file containing the xml is only on the server
    then it must be serverside.

    Why does the browser need to know it is XML? Are trying to show the data
    in the XML or the XML? Did you try looking at the HTML Source from within
    the browser.

    If you send pure XML back to the client you need to send it with an XML MIME
    type. To display xml (i.e. <Test>This is a test</Test>) you will need to
    encode the XML. To display the data you will need to parse the XML and use
    JavaScript to place the data extracted from the XML into the HTML table.
    This can occur client or server. You probably would only do it client-side
    if you are doing an XML island for dynamic data change without going back
    server-side. I've never done it client side with HTML and a data island
    but, as javascript and HTML go, it is simple enough.

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center