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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:47:49+00:00 2026-06-13T08:47:49+00:00

I have an XML document for which I want to sort specific nodes alphabetically.

  • 0

I have an XML document for which I want to sort specific nodes alphabetically.

XML document

<response>
    <lst name="facet_counts">
        <lst name="facet_fields">
            <lst name="professions_raw_nl">
                <int name="Pharmacy">2724</int>
                <int name="Physiotherapy">2474</int>
                <int name="Doctor">2246</int>
                <int name="Dentist">1309</int>
            </lst>  
        </lst>
    </lst>
</response> 

Desired output
Dentist (1309)
Doctor (2246)
Pharmacy (2724)
Physiotherapy (2474)

Current ASP.NET code

dim node as XmlNode = objXML.SelectSingleNode("response/lst[@name=""facet_counts""]/lst[@name=""facet_fields""]/lst[@name=""professions_raw_nl""]")
Dim sbuilder As New StringBuilder
Dim navigator As XPathNavigator = node.CreateNavigator()
Dim selectExpression As XPathExpression = navigator.Compile("???") <-- what expression should I use here ???
selectExpression.AddSort("????", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text) <-- what expression should I use here ????
Dim nodeIterator As XPathNodeIterator = navigator.Select(selectExpression)
While nodeIterator.MoveNext()
    'how can I print the name and value of the node?
End While
  • 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-13T08:47:50+00:00Added an answer on June 13, 2026 at 8:47 am

    Since all answers seem to work with Linq and I just wanted to use regular VB.NET I now added each node in an Arraylist and used the regular Array.Sort() on it.
    Does the trick.

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

Sidebar

Related Questions

Within Symphony CMS, I want to be able to have an XML document which
I have an XML document which contains nodes like following:- <a class=custom>test</a> <a class=xyz></a>
I have one XML document which I want to store it inside ViewState so
I have an XML document from which I want to remove white spaces and
I have a reasonably complex XML document which I want to flatten down to
I have a document which uses an XML namespace for which I want to
I have an XML document in which I want to search for some elements
I have a xml document which has a node that contains a proper name
I have an xml document which i want to pass as a parameter to
I have an xml document which consists of a number of the following: -

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.