problem with XmlHttpRequest.responseXML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    problem with XmlHttpRequest.responseXML

    i m generating a xml file through jsp file using AJAX.

    my response header in jsp file is like this ..

    <%@ page contentType = "text/xml;charset = WINDOWS-1252"%>

    when i do XmlHttpRequest. responseText the xml content is displayed but when i do the same thing with XmlHttpRequest. responseXML.

    what's the problem with XmlHttpRequest. responseXML..
    Plz explain XmlHttpRequest. responseXML..

    Plz help.
    Regards.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    See thsi link It should answer your question.

    responseXML will be empty unless the response is valid XML with the correct headers.

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      ok i got my answer....

      actually i use OPERA so i have to use xmlhttprequest. overrideMIMEtyp e('text/xml') even i do in the server side ..... reponse header --- MIME-TYPE as text/xml.

      okk thanxxxx.
      Reagards.

      Comment

      • satyanarayana49
        New Member
        • May 2007
        • 8

        #4
        Originally posted by dmjpro
        i m generating a xml file through jsp file using AJAX.

        my response header in jsp file is like this ..

        <%@ page contentType = "text/xml;charset = WINDOWS-1252"%>

        when i do XmlHttpRequest. responseText the xml content is displayed but when i do the same thing with XmlHttpRequest. responseXML.

        what's the problem with XmlHttpRequest. responseXML..
        Plz explain XmlHttpRequest. responseXML..

        Plz help.
        Regards.
        Yes,if u want to view the XML content of the response object u have to call
        XmlHttpRequest. responseText.
        If u alert the XmlHttpRequest. responseXML it shows an [object].

        Use XmlHttpRequest. responseXML method to handle the XML file on the browser side.Use XmlHttpRequest. responseXML.doc umentElement to get the root node of the XML file.By using this u can go thru' whatever the nodes and attributes of the nodes u want to display.There r several DOM methods available like.... XmlHttpRequest. responseXML.doc umentElement.ge tElementsBytagN ame
        XmlHttpRequest. responseXML.doc umentElement.ch ildNodes.length
        XmlHttpRequest. responseXML.doc umentElement.ch ildNodes[4].firstChild.tex t

        So XmlHttpRequest. responseXML is used to handle the XML file on the browser.

        Comment

        • dmjpro
          Top Contributor
          • Jan 2007
          • 2476

          #5
          is the story is true what u tellling ..... a new idea leads me to a new world of web-technology ... today i will implement this .....

          can u give me a good link about it in which i can see the details on XML parsing .....

          thanxxxxx ... a lot of Thanks.

          Kind Regards.

          Comment

          • satyanarayana49
            New Member
            • May 2007
            • 8

            #6
            Originally posted by dmjpro
            is the story is true what u tellling ..... a new idea leads me to a new world of web-technology ... today i will implement this .....

            can u give me a good link about it in which i can see the details on XML parsing .....

            thanxxxxx ... a lot of Thanks.

            Kind Regards.
            You can go to this site http://aspalliance.com/1194_Web_Applic ations_with_AJA X

            Comment

            • dmjpro
              Top Contributor
              • Jan 2007
              • 2476

              #7
              thanx ........ thanx a lot ...

              that's waht i look for... again thanx.

              kind regards.
              dmjpro.

              Comment

              • dmjpro
                Top Contributor
                • Jan 2007
                • 2476

                #8
                so getElementsByTa gName .... this is the main thing i have to use frequently ...

                that means using this method i can get all the desired values in a XML file.
                m i right?

                one more thing, requesting for a HTML file using AJAX is nothing but a fool job.....mainly AJAX is for requesting for a XML file then processing the node values using this method.

                any suggestion is most welcome.
                kind regards.
                dmjpro.

                Comment

                • satyanarayana49
                  New Member
                  • May 2007
                  • 8

                  #9
                  Originally posted by dmjpro
                  so getElementsByTa gName .... this is the main thing i have to use frequently ...

                  that means using this method i can get all the desired values in a XML file.
                  m i right?

                  one more thing, requesting for a HTML file using AJAX is nothing but a fool job.....mainly AJAX is for requesting for a XML file then processing the node values using this method.

                  any suggestion is most welcome.
                  kind regards.
                  dmjpro.
                  check this link http://www.sitepoint.c om/article/server-side-xml-javascript

                  Comment

                  Working...