Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Connection Manager responseXML

Expand Messages
  • Satyam
    I recall some recent conversation about the same subject and the problem seemed to be some whitespace before the first opening angled bracket in the opening
    Message 1 of 6 , Nov 30, 2007
    • 0 Attachment
      I recall some recent conversation about the same subject and the problem
      seemed to be some whitespace before the first opening angled bracket in the
      opening XML declaration. The thread should be in the Yahoo Groups site,
      there might have been something else, this is all that I remember about it.

      Satyam

      ----- Original Message -----
      From: "dvidluca" <dvidluca@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Friday, November 30, 2007 9:39 PM
      Subject: [ydn-javascript] Connection Manager responseXML


      > Hi,
      >
      > I have a simple PHP script that uses curl to obtain an RSS news feed
      > (very similar to the PHP proxy shown on the developer network). I have
      > tried echoing this and using o.responseXML but this property is null.
      > o.responseText is populated with a textual string of the complete RSS
      > file.
      >
      > How can I just pass the whole XML file to Connection Manager with the
      > PHP file so that o.responseXML is populated?
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      > --
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.503 / Virus Database: 269.16.10/1160 - Release Date:
      > 29/11/2007 20:32
      >
      >
    • tssha
      ... Have you the appropriate content type header defined? Example: header( Content-Type:text/xml ); If so, let s have a look at the XML you re sending from PHP
      Message 2 of 6 , Nov 30, 2007
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "dvidluca" <dvidluca@...> wrote:
        >
        > Hi,
        >
        > I have a simple PHP script that uses curl to obtain an RSS news feed
        > (very similar to the PHP proxy shown on the developer network). I have
        > tried echoing this and using o.responseXML but this property is null.
        > o.responseText is populated with a textual string of the complete RSS
        > file.
        >
        > How can I just pass the whole XML file to Connection Manager with the
        > PHP file so that o.responseXML is populated?

        Have you the appropriate content type header defined?
        Example: header("Content-Type:text/xml");

        If so, let's have a look at the XML you're sending from PHP to the client.

        Regards,
        Thomas
      • dvidluca
        Really sorry, I wasn t setting the header content type to text/xml. o.responseXML is now populated!
        Message 3 of 6 , Nov 30, 2007
        • 0 Attachment
          Really sorry, I wasn't setting the header content type to text/xml.
          o.responseXML is now populated!
        • dvidluca
          I ve still got issues though! in the RSS file there are a series of nodes and each has a series of child nodes such as and
          Message 4 of 6 , Nov 30, 2007
          • 0 Attachment
            I've still got issues though!

            in the RSS file there are a series of <item> nodes and each <item>
            has a series of child nodes such as <title> <description> and others.

            I can do:

            var items = root.getElementsByTagName("item");
            alert(items.length);

            and the alert says 26 so I'm getting he XML file, the o.responseXML
            property is populated and I can get nodes from it. But, if I do:

            var title = root.getElementsByTagName("item")[0].childNodes
            [0].nodeValue;
            alert(title);

            The alert says null. I can get the item nodes but I can't get the
            nodeValue of the first child of the first item node.

            Why is this?
          • dvidluca
            ok, I got it, using: var titles = root.getElementsByTagName( title ); alert(titles[2].firstChild.nodeValue); Gives me the text from the third node that
            Message 5 of 6 , Nov 30, 2007
            • 0 Attachment
              ok, I got it, using:

              var titles = root.getElementsByTagName("title");
              alert(titles[2].firstChild.nodeValue);

              Gives me the text from the third <title> node that I want :]

              thanks
            Your message has been successfully submitted and would be delivered to recipients shortly.