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

x
  • 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

thanks
0
cakirfatih
Asked:
cakirfatih
1 Solution
 
b1xml2Commented:
fortune telling days are over.

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

concat("www.thisismydomain.com", "12340")
0
 
cakirfatihAuthor Commented:
:)
here is an example:
<process>
    <properties>
        <id>7b51462e00a7a849000000fc03e3dd0b8001</id>
        <name>111-11-1111</name>
        <startTime>Mon Apr 19 13:14:28 CDT 2004</startTime>
        <timeoutTime/>
        <priority>Medium</priority>
        <requester>vgnadmin</requester>
    </properties>
    <inputs>
        <vgnPayloadId>e458666c3e30cf00VgnVCM1000006a29140aWFPY</vgnPayloadId>
        <vgnGroup>bpgroup</vgnGroup>
    </inputs>
    <payload>
        <item id="4f48666c3e30cf00VgnVCM1000006a29140aRCRD">
            <VignCreationTime>Mon Apr 19 13:14:27 CDT 2004</VignCreationTime>
            <VignCreator>vgnadmin</VignCreator>
            <VignLastModComment/>
            <VignLastModifier>vgnadmin</VignLastModifier>
            <VignLastModTime>Mon Apr 19 13:14:27 CDT 2004</VignLastModTime>
            <VignLockCount>0</VignLockCount>
            <VignLockOwner/>
            <VignLockTime/>
            <BillInfo>
                <VignVCMId>4f48666c3e30cf00VgnVCM1000006a29140aRCRD</VignVCMId>
                <VignLogicalPath>/MiscContent</VignLogicalPath>
                <VignName>111-11-1111</VignName>
                <Name>John Smith</Name>
                <Address>123 Main St.</Address>
                <Phone>555-555-5555</Phone>
                <SSN>111-11-1111</SSN>
            </BillInfo>
        </item>
    </payload>
</process>

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.
Thanks
0
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!

 
J_MakCommented:
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"/>
            <Task3>
                  <xsl:value-of select="concat($Task1,$Task2)"/>
            </Task3>
      </xsl:template>
</xsl:stylesheet>

Cheers.
0
 
b1xml2Commented:
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.
0
 
wuerziCommented:
i belief you can't combine the values of two nodes with XPath. You can query both nodes with one XPath

/process/payload/item/VignLastModifier[1]/text()|/process/payload/item/VignLockOwner[1]/text()

but than you have a NodeListe.
0

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