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 8973877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:32:50+00:00 2026-06-15T18:32:50+00:00

I need to select the siblings of root and only for the first level.

  • 0

I need to select the siblings of root and only for the first level.

I’m selecting html and it can be anyting…

ex:

<p><img...></p>
<p><img...></p>
<ul><li><a>somelink</a></li></ul>
<a>... 

what i tryed was this /*[following-sibling::*] but that only selects the two <p><img...></p>…

what i want is to select the first level as in P P ul a.

Im useing Html Agillity Pack and my code looks like this:

        var nodeCollection = new List<HtmlNode>();
        var document = new HtmlDocument();
        document.LoadHtml(html);

        if (document.DocumentNode != null)
        {
            foreach (var node in document.DocumentNode.SelectNodes("/*[following-sibling::*]"))
            {
                nodeCollection.Add(node);
            }

Anyone know what im doing wrong ?

  • 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-15T18:32:51+00:00Added an answer on June 15, 2026 at 6:32 pm

    I think i found a working xpath and it was not so hard xD
    the following worked: /child::*

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i express in xpath a) need select elements which contains specified keyword.
I need to select elements of a certain class except children of $(this). The
I need to select only 20 records from the table and than add pagination
I need to select elements depending on first letter of text value of a
$country.parent().parent().next().children('td').children('.province-select') Basically I have some HTML that looks like this: <table> <tr> <th>country</th> <td><select
I need to iterate through multiple-node structures, but this structure is only identified by
I need to select the position of a following sibling via XSL. This is
I need to select elements without child node (including text since in <p> text
I need to select all from table1 where active=1 and replace t1cid,t2cid,L1cid,L2cid---L10cid with corresponding
I need to select all entries between two given dates (Nov 10 and Jan

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.