Bhuvanesh
Bhuvanesh

Reputation: 31

How do i do concat more than one tag value in vtd XML?

How do I concatenate multiple tag values using XPATH on vtd XML?

  <pre>
      <a>
        <b>
           <c>Hi</c>  
           <d>Vtd</d>
           <e>Users</e>
        </b>
      </a>
  </pre>

I have tried to use the following unsuccessfully.

    Xpath: concat(\a\b\c, \a\b\d, \a\b\e)   Result is : Hi Vtd Users

If I use concat with this XPATH, I receive the following error:

    Error "Function Expr can't eval to node set"

Upvotes: 3

Views: 268

Answers (1)

Ryan Gates
Ryan Gates

Reputation: 4539

You need to make sure that you are starting from the root node and that your axes are correct. The below XPath returns the desired output.

concat(pre/a/b/c, " ", pre/a/b/d, " ", pre/a/b/e)

Upvotes: 1

Related Questions