xpath concat function()

Posted on 2005-04-21
Last Modified: 2008-01-09
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 : ""
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

Question by:cakirfatih
    LVL 23

    Expert Comment

    fortune telling days are over.

    please kindly provide some of the code you are using, plus the xml file structure.
    LVL 5

    Expert Comment

    The following function call returns "www.thisismydomain.com12340".

    concat("", "12340")

    Author Comment

    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.
    LVL 7

    Expert Comment

    Try this:

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="" 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)"/>

    LVL 23

    Expert Comment

    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.
    LVL 1

    Accepted Solution

    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

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now