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

  • Home
  • SEARCH
  • 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 8846973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:06:56+00:00 2026-06-14T12:06:56+00:00

I have an xml file like that : <?xml version=1.0 encoding=utf-8?> <KWS> <KW> <KWNAME>make

  • 0

I have an xml file like that :

<?xml version="1.0" encoding="utf-8"?>
<KWS>
  <KW>
    <KWNAME>"make money online youtube video"</KWNAME>
    <GSC>318,000</GSC>
    <YSC>821</YSC>
    <TOP10>6</TOP10>
    <TOP100>61</TOP100>
    <SEARCH-US-C>0</SEARCH-US-C>
    <NOTE>
    </NOTE>
    <YTLINKS>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=Dh5vptODX-M</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=YtjvHX6VfcY</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=WDfJoDCdvyw</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=yRUEffXbokw</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=YYsqgs5ve78</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=7WaG3D-tSrs</LINK>
      </YT-LINK>
    </YTLINKS>
  </KW>
  <KW>
    <KWNAME>"linkin park video youtube"</KWNAME>
    <GSC>130,000</GSC>
    <YSC>4,300</YSC>
    <TOP10>7</TOP10>
    <TOP100>69</TOP100>
    <SEARCH-US-C>0</SEARCH-US-C>
    <NOTE>
    </NOTE>
    <YTLINKS>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=ij34hCOMiIU</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=mTMl5dRw8WI</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=b-JehygMcJ8</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=b2dmMxnUosc</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=hZ62r3Q6ohA</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=dREoOlTeYs4</LINK>
      </YT-LINK>
      <YT-LINK>
        <LINK>http://www.youtube.com/watch?v=42xL8MG3xfQ</LINK>
      </YT-LINK>
    </YTLINKS>
  </KW>
</KWS>

My C# code to get every LINK inside YT-LINK

        XmlDocument xml = new XmlDocument();
        xml.Load(file);

        XmlNodeList nodes = xml.SelectNodes("//KW");

        foreach (XmlNode node in nodes)
        {
            KWDATA k = new KWDATA();

            k.KEYWORD = node.SelectSingleNode("KWNAME").InnerText;
            k.GSC = node.SelectSingleNode("GSC").InnerText;
            k.YTC = node.SelectSingleNode("YSC").InnerText;
            k.N_VIDEOS_TOP_10 = node.SelectSingleNode("TOP10").InnerText;
            k.N_VIDEOS_TOP_100 = node.SelectSingleNode("TOP100").InnerText;
            k.N_OF_KW_SEARCH_IN_GOOGLE = node.SelectSingleNode("SEARCH-US-C").InnerText;

            List<string> YT_LINKS = new List<string>();
            foreach (XmlNode node2 in node.SelectNodes("YTLINKS")) // <-- i know something is wrong here
            {
                MessageBox.Show(node2.SelectSingleNode("YT-LINK").InnerText);
                YT_LINKS.Add(node2.SelectSingleNode("YT-LINK").InnerText);
            }
            k.YTLINKS = YT_LINKS;

but i only get the first link for each entry like :

http://www.youtube.com/watch?v=Dh5vptODX-M

Only and the rest won’t be retrieved.

  • 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-14T12:06:57+00:00Added an answer on June 14, 2026 at 12:06 pm

    The “YTLINKS” node is a single one, you can select that one first, then iterate through the collection of “YTLINK” nodes within:

    var ytlinks = node.SelectSingleNode("YTLINKS");
    
    foreach (XmlNode node2 in ytlinks.SelectNodes("YTLINK"))
    {           
        YT_LINKS.Add(node2.InnerText);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1
I have an XML File that looks like this: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
I have an XML/Soap file that looks like this: <?xml version=1.0 encoding=utf-8?> <soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope
I have a simple xml file that looks like this: <?xml version=1.0 encoding=UTF-8 standalone=yes
I have an XML file formatted like this: <?xml version=1.0 encoding=utf-8?> <Snippets> <Snippet name=abc>
I have an xml file like this, <?xml version=1.0 encoding=utf-8 ?> <root> <FeaturedProductCategories> <FeaturedProductCategory>
I have an XML file that looks like <?xml version=1.0> <playlist> <name>My Playlist</name> <song>
I have an XML file that reads like this <abc> <ab>value</ab> <aa>time</aa> <ac>money</ac> </abc>
I have an xml file. <?xml version=1.0 encoding=UTF-8?> <channel> <item>content with special character é</item>
I have a snippet of an xml file that looks like this: <?xml version=1.0

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.