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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:10:55+00:00 2026-05-26T08:10:55+00:00

So say I have a node structure like: <Row> <Column Name=Primary Number>1</Column> <Column Name=Secondary

  • 0

So say I have a node structure like:

<Row>
 <Column Name="Primary Number">1</Column>
 <Column Name="Secondary Number">01</Column>
 <Column Name="Text">This is all one sentence</Column>
<Row>
 <Column Name="Primary Number">1</Column>
 <Column Name="Secondary Number">02</Column>
 <Column Name="Text">I would like to return</Column>
<Row>
 <Column Name="Primary Number">1</Column>
 <Column Name="Secondary Number">03</Column>
 <Column Name="Text">as one string, in one xpath line</Column>

First of all I would like to say this is not my xml, nor did I help construct it. But I am forced to use it to retrieve the info I need….So please help.

So what I would like to do using one XPath, is to return one string containing the text from all n number of Text fields of all Primary Number=1 nodes.
Is this possible using XPath 1.0?

I have a not-so elegant solution, but it only works if I know the exact number of secondary numbers, and then it’s just a bunch of messy concat()’s…

Hello all, and thanks for everyone’s response!
So what I wanted to do with this string, was use contains() to search for specific keywords, but I found a shortcut around actually having a concatenated string of all the values to do so, and just had to share it in case someone had a similar problem.
Tod’s hint helped quite a bit with this, I just added a conditional to it and BAM magic.
Here it is:

Table[@Name='TableName']/Row/Column[@Name='Text' and contains(text(),"keyword")][preceding-sibling::Column[@Name='Primary Number' and text()='15']]

So what this does is instead of concatenating all of the node value results as one string then using contains() on it, it searches each line for the word separately and thus removes the need for the impossible.
Thanks for all the help guys, couldn’t have done it without all the great responses!

(I’d give everyone vote ups, but I’m too new 🙁 )

  • 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-05-26T08:10:55+00:00Added an answer on May 26, 2026 at 8:10 am

    This seems to be working here:

    //Row/Column[@Name="Text"][preceding-sibling::Column[@Name="Primary Number"]/text()="1"]
    

    returns:

    This is all one sentence
    I would like to return
    as one string, in one xpath line
    

    Although, I’m not sure if you find the new lines in the result string acceptable.

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

Sidebar

Related Questions

Lets say I have an xml structure like this: <s> <a> <b id=myid>value1</b> <c
Say I have this given XML file: <root> <node>x</node> <node>y</node> <node>a</node> </root> And I
I have an xml document where an xml node with a particular name, say
I have an XML doc with a structure like this: <Book> <Title title=Door Three/>
In C# I have an intrusive tree structure that looks like this: public abstract
Let's say I have a structure to visit in a recursive way. Pseudocode: visit(node
Lets say have this immutable record type: public class Record { public Record(int x,
Let's say have something like: SELECT energy_produced, energy_consumed, timestamp1 AS timestamp FROM ( SELECT
Say I have the following file structure: app/ app.py controllers/ __init__.py project.py plugin.py If
Say I have a class named Frog, it looks like: public class Frog {

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.