WordPress.org

Ready to get started?Download WordPress

Forums

FeedWordPress
Posts & Links:How can I select the attribute of a single element from multiples? (1 post)

  1. Su
    Member
    Posted 1 year ago #

    In a YouTube favorites feed, the items look like:


    <entry gd:etag='W/"DEMHRn47eCp7I2A9WhNVGUU."'>
    <id>xxx</id>
    <published>xxx</updated>
    <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#favorite'/>
    <title>xxx</title>
    <link rel='alternate' type='text/html' href='VIDEO PERMALINK'/>
    <link rel='related' type='application/atom+xml' href='RELATED URLS'/>
    <link rel='self' type='application/atom+xml' href='FEED SELF-LINK'/>
    <author>xxx</author>
    </entry>

    Note the multiple link elements.
    My problem is that I need the href value of the first of those, and $(link/@href) in Custom Post Settings returns the value of the last one. I've tried $(link[1]/@href) which seems like it might be correct XPath, but it doesn't work. And since whatever flavor FWP is using isn't really documented I have no idea if it's me that's wrong or the plugin.

    http://wordpress.org/extend/plugins/feedwordpress/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.