XmlHttpRequest & responseXml

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marco Laponder

    XmlHttpRequest & responseXml

    Hi All,

    I am using XmlHttpRequest object within Firefox to get a xml document
    from the servlet. The reponseText is set but the responseXml is null.

    My Code is:
    req = new XMLHttpRequest( );
    req.open('GET', './transform?resou rce=xul', false);
    req.send(null);

    When I print rq.getAllHeader s it says:

    Content-type: application/xml

    I can create a DOM object by:
    var parser = new DOMParser();
    var dom = parser.parseFro mString(req.res ponseText, "text/xml");

    Anyone got any ideas what can be the problem ? the parseFromString is
    very slow for large documents so this is not a good option for me

    Kind regards,
    Marco Laponder
    mlr@interchain. nl
  • Martin Honnen

    #2
    Re: XmlHttpRequest & responseXml



    Marco Laponder wrote:

    [color=blue]
    > I am using XmlHttpRequest object within Firefox to get a xml document
    > from the servlet. The reponseText is set but the responseXml is null.
    >
    > My Code is:
    > req = new XMLHttpRequest( );
    > req.open('GET', './transform?resou rce=xul', false);
    > req.send(null);
    >
    > When I print rq.getAllHeader s it says:
    >
    > Content-type: application/xml[/color]

    A bit odd indeed, do you have a public URL where that occurs?
    But you write responseXml while the property is named responseXML, so
    maybe you have got the property name wrong?


    --

    Martin Honnen

    Comment

    • Jeremy Nixon

      #3
      Re: XmlHttpRequest & responseXml

      Marco Laponder <mlr@interchain .nl> wrote:
      [color=blue]
      > I am using XmlHttpRequest object within Firefox to get a xml document
      > from the servlet. The reponseText is set but the responseXml is null.[/color]

      Make sure you're looking for responseXML, not responseXml.
      [color=blue]
      > When I print rq.getAllHeader s it says:
      >
      > Content-type: application/xml[/color]

      Try sending "text/xml" instead.

      --
      Jeremy | jeremy@exit109. com

      Comment

      Working...