• damassipappas

    (@damassipappas)


    Hi everyone,

    I’m having a difficult time using fetch_rss to access the content childNode:

    Example:

    XML:

    <feed>
    <title>title accessed fine</title>
    <content type="xhtml">
       <div xmlns="https://www.w3.org/1999/xhtml">
          <p>this is the content I want to access</p>
       </div>
    </content>
    </feed>

    PHP:

    normal function stuff…

    // the below works for accessing the title node
    $item['title'];
    
    // and this DOESN'T work
    $item['content']['div']['p'];

    Note that the above is a highly stripped down version of what the feed actually looks like.

    Am I incorrectly understanding the syntax construct?

    Any help is greatly appreciated.

    -Chris

Viewing 1 replies (of 1 total)
  • Chris,

    I’m having the same issue: I’m trying to access the components under the author tag but can’t seem to figure it out (mind you I’ve been learning this stuff on the fly today but I’m non-the-less experienced with programming languages).

    I want to make the name of the author a link… and everything I need is there, however they are children of the <author> tag… For instance

    <author>
     <name>author name</name>
     <uri>their url</uri>
     </author>

    I can access other parts of the feed…

    $item['content'];
    // returns content
    $item['published'];
    // returns the published date
    $item['author'];
    // returns nothing...

    Any insight for these issues?

Viewing 1 replies (of 1 total)
  • The topic ‘Using fetch_rss to access childNodes?’ is closed to new replies.