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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:01:59+00:00 2026-06-07T10:01:59+00:00

I am working on an asp.net application based on .net 2.0. And I meet

  • 0

I am working on an asp.net application based on .net 2.0.

And I meet some problems when I process the XML.

Suppose I have XML like this:

<person name="xxxyx" age="32" />

<person name="zzz" age="32" />

<person name="yyyxx" age="32" />

Now I want to select the person whose name contains yx

How do I use xpath to implement it?

I only know this expression will match the person whose name is exactly “yx”:

"//person[name='yx'"]"

How to make the fuzzy search?

BTW, any idea to sort the matched person by the specified attribute like “name”?

  • 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-07T10:02:01+00:00Added an answer on June 7, 2026 at 10:02 am

    Like @Utkanos suggested //person[contains(@name, 'yx')] should match the nodes you want.

    XPath itself is, at least at my knowledge, not capable and not intended to provide order on nodes, but instead returns node-sets which are “unordered collection of nodes without duplicates” (see 1 and comments). However in version 2.0 there might be changes to this 2 with which I am not familiar.

    Assuming the sorting should be done in an XSL transformation you could use <xsl:sort /> like this:

    <xsl:apply-templates select="//person[contains(@name, 'yx')]">
        <xsl:sort select="@name" />
    </xsl:apply-templates>
    

    There are some more attributes on <xsl:sort /> documented here: http://www.w3.org/TR/xslt#sorting

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

Sidebar

Related Questions

I am working on asp.net application and I have an update panel like this:
I am working on a web-based application using asp.net 4.0. I have some dlls
I have been working on asp.net mvc3 e-commerce application based on NopCommerce. Recently we
I am working with a Web application, based on Asp.Net 3.5 and WSS 3.0
I am working on asp.net application and I have generated entity model (edmx) from
When working with an ASP.Net application, when I rebuild the solution, I would like
I am working on asp.net based application. I am using multi-line textbox and I
I have a multiple web sits asp.net application. In this application different domains using
Here's what i have : ASP.NET 4.0 Web Application Forms Authentication (Cookie Based) Here's
I am working on a test application based on ASP.NET MVC. I am new

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.