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

  • Home
  • SEARCH
  • 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 3353986
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:13:04+00:00 2026-05-18T02:13:04+00:00

Is there a way to correctly concatenate three arbitrary XPath expressions to result in

  • 0

Is there a way to correctly concatenate three arbitrary XPath expressions to result in a new valid XPath expression?

  • 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-18T02:13:04+00:00Added an answer on May 18, 2026 at 2:13 am

    Update: The OP has indicated in a comment that the three expressions select text nodes.

    In this case using the union operator (|) seems most appropriate.


    Is there a way to correctly
    concatenate three arbitrary XPath
    expressions to result in a new valid
    XPath expression?

    There are many possible ways to do this and some of these may benefit from knowing the return type of the evaluation.

    One of the combinator that always “works” (although maynot always be meaningful) is:

    concat(Expr1, Expr2, Expr3)
    

    Other examples:

    number(Expr1) + number(Expr2) + number(Expr3)
    
    boolean(Expr1) or boolean(Expr2) or boolean(Expr3)
    

    In case the expressions are guaranteed to select a node-set, then this expression (the union of the node-sets) would also combine them:

    Expr1 | Expr2 | Expr3
    

    In XPath 2.0 this expression should always work (concatenation to a sequence of items):

    Expr1 , Expr2 , Expr3
    

    or this one:

      if(boolean(Expr1))
        then Expr2
        else Expr3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have trouble finding way to correctly refactor this code so that there would
Is there any way to uninstall the VS2010 extension correctly without the Extension Manager?
Is there any way to detect and handle whether a Java library is correctly
I'm developing a facebook app. The tab removes correctly, but is there a way
Is there a way to read date time correctly regardless of date format (e.g.
Is there any way I can see if windows updates installed correctly or failed.
In Visual Studio 2005, is there a way to indent correctly the tags in
Is there a correct way in Windows Forms to flash a titlebar without having
Is there a way to find currently active http connections in a page? For
HI, Is there any 'correct' way to convert an XElement to an XmlNode in

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.