Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 679
  • Last Modified:

xpath concat function()

I am trying to build a URL in a workflow task but anyways here is what i m trying to do:

Task 1  will return a string like this : "www.thisismydomain.com"
Task 2 is an automated task that return another string somethis like this: "12340"

I am trying to concatinate the two strings so "www.thisismydomain.com12340"

can someone gimme the exression in Xpath 1.0 and Xpath 2.0

1 Solution
fortune telling days are over.

please kindly provide some of the code you are using, plus the xml file structure.
The following function call returns "www.thisismydomain.com12340".

concat("www.thisismydomain.com", "12340")
cakirfatihAuthor Commented:
here is an example:
        <startTime>Mon Apr 19 13:14:28 CDT 2004</startTime>
        <item id="4f48666c3e30cf00VgnVCM1000006a29140aRCRD">
            <VignCreationTime>Mon Apr 19 13:14:27 CDT 2004</VignCreationTime>
            <VignLastModTime>Mon Apr 19 13:14:27 CDT 2004</VignLastModTime>
                <Name>John Smith</Name>
                <Address>123 Main St.</Address>

I have this in Task 1: /process/payload/item/*/VignLastModifier[1]
and this   in Task 2: /process/payload/item/*/VignLockOwner[1]

And finally the result of Task 3 should be: concat('/process/payload/item/*/VignLastModifier[1]', '/process/payload/item/*/VignLockOwner[1]')
let s see your skills in fortune telling.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Try this:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="xml"/>
      <xsl:template match="/">
            <xsl:variable name="Task1" select="/process/payload/item/VignLastModifier"/>
            <xsl:variable name="Task2" select="/process/payload/item/VignLockOwner"/>
                  <xsl:value-of select="concat($Task1,$Task2)"/>

i know you re using VB.NET, if you are using transformations then J_Mak's example shows you the way. But something in your question tells me you know about this and then you just want an expression that you can execute against the Xml Tree and return the result.

Please confirm if this is so.
i belief you can't combine the values of two nodes with XPath. You can query both nodes with one XPath


but than you have a NodeListe.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now