Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8500559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:58:43+00:00 2026-06-11T00:58:43+00:00

for each entry in this xml, i need to get the title and the

  • 0

for each entry in this xml, i need to get the “title” and the first thumbnail image. that is the first image in the media:group

<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/'>
<entry>
<title>Progression! 9 more pounds to goo!</title>
<media:group>
<media:thumbnail url='http://i.ytimg.com/vi/7MTjYXt3rLQ/default.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/7MTjYXt3rLQ/mqdefault.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/7MTjYXt3rLQ/hqdefault.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/7MTjYXt3rLQ/1.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/7MTjYXt3rLQ/2.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/7MTjYXt3rLQ/3.jpg'/>
</media:group>
</entry>
<entry>
<title>Plank Variations Workout with Max Wettstein</title>
<media:group>
<media:thumbnail url='http://i.ytimg.com/vi/O1Nd8lZFGpc/default.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/O1Nd8lZFGpc/mqdefault.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/O1Nd8lZFGpc/hqdefault.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/O1Nd8lZFGpc/1.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/O1Nd8lZFGpc/2.jpg'/>
<media:thumbnail url='http://i.ytimg.com/vi/O1Nd8lZFGpc/3.jpg'/>
</media:group>
</entry>
</feed>

this is my code

 Dim xmlDoc As MSXML2.DOMDocument30
    Dim xmlEntryNode As MSXML2.IXMLDOMNode
    Dim xmlEntryNodes As IXMLDOMNodeList
    Dim xmlC1Nodes As IXMLDOMNodeList
    Dim ns As String
    Set xmlDoc = New DOMDocument30
    ns = txtNS.Text
    xmlDoc.setProperty "SelectionLanguage", "XPath"
    xmlDoc.setProperty "SelectionNamespaces", ns

    If xmlDoc.loadXML(txtXml.Text) = False Then
        appendText "xml document load failed"
        Exit Sub
    End If
    Set xmlEntryNodes = xmlDoc.documentElement.selectNodes(/x:feed/x:entry)
    Dim i As Integer
    For i = 0 To xmlEntryNodes.length - 1
        Set xmlEntryNode = xmlEntryNodes(i)
        appendText xmlEntryNode.Text
        Set xmlC1Nodes = xmlDoc.selectNodes(//media:group/media:thumbnail[1]/@url)
        If xmlC1Nodes.length > 0 Then
            Dim j As Integer
            For j = 0 To xmlC1Nodes.length - 1
                appendText xmlC1Nodes(j).Text
            Next
        End If
    Next

    Exit Sub

and here is my output

Progression! 9 more pounds to goo!  
http://i.ytimg.com/vi/7MTjYXt3rLQ/default.jpg   
http://i.ytimg.com/vi/O1Nd8lZFGpc/default.jpg    Plank Variations
Workout with Max Wettstein  
http://i.ytimg.com/vi/7MTjYXt3rLQ/default.jpg   
http://i.ytimg.com/vi/O1Nd8lZFGpc/default.jpg

can anyone pls help me adjust to make it return only one image for each entry

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:58:45+00:00Added an answer on June 11, 2026 at 12:58 am

    I’m not well-versed in VB6, but coming at this from an XPath point of view, I would select relative to the xmlEntryNode you’ve already got:

    Set xmlC1Nodes = xmlEntryNode.selectNodes("media:group/media:thumbnail[1]/@url")
    

    (I don’t understand why your XPath expression isn’t in quotes… But you said it produces output…)

    Or if the selectNodes() method only applies to XML documents, then

    Set xmlC1Nodes = xmlDoc.selectNodes(
            "/*/x:entry[" + i + "]/media:group/media:thumbnail[1]/@url")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have XML like this: <article> <title>Article 1 title</title> <text>Lorem ipsum...</text> <image>http://example.com/img_01.jpg</image> </article> <article>
This is the code: xml = REXML::Document.new(data) @contacts = Array.new xml.elements.each('//entry') do |entry| person
I've got an XML response that looks like: <?xml version=1.0 encoding=utf-8?> <response> <scheme> <name>name_1</name>
function xmlParser(xml, projectName) { var currentIndex = 0; $(xml).find('entry').each(function(){ if($(this).attr('projectName').toLowerCase() == projectName) { $previous
I have a csv file that contains XML entries. Imagine that each XML entry
I have a cron entry that runs a script at a certain time each
Short Version I have a list of int s that I need to figure
I need to gather a list of distinct employees from an XML file that
Im using PHP to parse some XML, I take 3 details from each entry
I have an XML file that has a set of entries like this: <attr

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.