Skip to Content
author's profile photo Former Member
Former Member

Manipulating node elements in a user defined function

Hi All,

I have a secnario like this:

Source Message

-


<address>

<line1>Line 1</line1>

<line2>Line 2</line2>

<line3>Line 3</line3>

</address>

-


Target Message

-


<address>Line1, Line2, Line3</address>

-


I want a mapping like as follows:

<address> --->concatenateAddresses ---> <address>

How can I access the individual lines from the source <address> element and concatenate them and pass to the target <address> element?

Is this possible?

Many Thanks,

Sandeep

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 08:00 AM

    Hi Michal,

    Thanks for the quick response. But my requirement is slightly different. I cannot predict the number of times the line element occur. Actually the occurence of the <line> element is 0...unbounded. I made a mistake in the example i gave. it should be

    <address>

    <line>Joseph</line>

    <line>St.Lawrence</line>

    <line>Quebec</line>

    ...

    <address>

    In the above example the <line> element occurs multiple times and i want to concatenate all of them before mapping to the target <address>

    Sorry for the confusion caused.

    Thanks,

    Sandeep

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 31, 2006 at 07:55 AM

    Hi,

    in this case you just need to create a user function

    that will take all 3 values (inbound)

    and contatenate them

    return a + b + c;

    Regards,

    michal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 07:58 AM

    Hi,

    <line1> concatenate <some field>---

    <line2>

    <line3> -


    Concatenate----Target.

    Just concatenate the line1 and line2 and then put the result into a field and then concatenate line3 to the outputfield.

    Regards

    Vijaya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 02:19 PM

    Hi Sandeep Joseph,

    I got same problem. Now i am going to write udf for this ,

    Please send me java code which you have for this problem.

    this is urgent. i will wait for this

    Thanks and regards

    sai

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.