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

The Archive Base Latest Questions

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

Im trying to select nodes that contain a given string in one of its

  • 0

Im trying to select nodes that contain a given string in one of its attributes, but it seems that I can only do it on a certain attribute.

var tempUsers = xmlDocument.selectNodes("//Users/*[contains(@Id,'TEXT')]");

I guess that instead of @Id I can write something else to check all the attributes of a node and not only the Id.

thanks.

  • 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-13T03:40:49+00:00Added an answer on June 13, 2026 at 3:40 am

    You can use @* in xpath to select all attributes, but the naive

    //Users/*[contains(@*,'TEXT')]
    

    will not do what you expect. The contains function expects its arguments to be strings, so if you give it a node set instead it will first convert the node set to a string (by taking the string value of the first node in the set) and then use that value in the function. Instead you need to say

    //Users/*[@*[contains(.,'TEXT')]]
    

    which will find all Users elements in the document and then select all their child elements that have any attribute whose value contains the substring TEXT.

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

Sidebar

Related Questions

In trying to select elements that have any attributes, the following throws a jQuery
I'm trying to select all dom elements that have id=mydiv but exclude the ones
The problem I'm trying to solve is to get all elements that contain only
I'm trying to find a way to index nodes that contain a specific type
I have this XSLT stylesheet, where I'm trying to find nodes that contain an
I'm trying to select nodes starting from nodes that are not root nodes of
I am trying to select only the topmost section H1s. In this fiddle ,
I am trying to select all the <set>erase</set> elements such that if two or
I am trying to implement a list that contains items of a certain type,
I'm trying to concatenate two fields in LINQ so that I can then filter

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.