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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:52:41+00:00 2026-06-10T08:52:41+00:00

How do you fetch records that contain a node that is a prefix to

  • 0

How do you fetch records that contain a node that is a prefix to a string you are searching for?

XML looks like this:

<records>
  <record>
    <name>foo</name>
    <prefix>abc</prefix>
  </record>
  <record>
    <name>bar</name>
    <prefix>def</prefix>
  </record>
  <record>
    <name>bar</name>
    <prefix>abc.123</prefix>
  </record>
</records>

So if I have string “abc.123.xyz”, I would fetch the first and third records.

Roughly translated to “/records/record[prefix[is-contained-in?(‘abc.123.xyz’)]]”

Any XPath functions that I see work the other way around (starts-with, contains), where you specify the substring instead of the node containing the substring.

  • 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-10T08:52:42+00:00Added an answer on June 10, 2026 at 8:52 am

    This matches record nodes in your sample:

     <xsl:template match="/">
          <xsl:apply-templates select="/records/record[starts-with(./prefix, substring-before('abc.123.xyz','.'))]"/>
     </xsl:template>
    

    substring-before

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

Sidebar

Related Questions

I want to fetch records which contain a certain substring(set of words). My problem
On my page I have a form that inserts a new record in to
I've got a fetch request that uses NSPredicate to capture an array of NSString
I have a few models that contain static data, and I'm trying to cache
There's a DB that contains approximately 300-400 records. I can make a simple query
I'm having trouble adding a where clause to this query. I would like it
I need to create a csv file that will contain all current Subscribers, plus
Is it possible to fetch records in parts? Following will return 10,000 rows from
This is one thing I can't understand. I'm using a function which fetches records
Hi, I have a linq to sql question like this : tmpAdList1 = (from

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.