on 07-11-2007 6:52 PM
I have to parse from a source field (x) and map to this structure:
<Line>
<Number\>
<Descr\>
<Code\>
</Line>
The source field is a string that contains newline characters (just a blob of text). Example:
ABC\nLine 1,widget, 123A\nXYZ\nLine 2,gadget,123B
I need to get at the line number, description, and code mapping values by parsing at newlines and then parse into the "Line" records. I want my result to look like this:
<Line>
<Number>1</Number>
<Descr>widget</Descr>
<Code>123A</Code>
</Line>
<Line>
<Number>2</Number>
<Descr>gadget</Descr>
<Code>123B</Code>
</Line>
Is there a way to chain message mapping functions and/or UDFs and do something like this? In addition, I don't see how I can specify multiple target fields in one mapping. Any suggestions would be appreciated. Thanks!
Keith,
We can do it using UDF. But Can u give us the exact source structure and which value corresponds to which field. It will be more helpful to suggest and proceed further.
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raj,
Unfortunately, the source structure is not well structured. It contains lines of data, of which some begin with "Line", and then a line number and other fields separated by commas. It also contains unused lines.
Production example of source data (with breaks at each newline character):
APPROVED
Tracking Reference: 20070629063604.1
Process Date: 06-29-2007 07:38:59
Listed below are the following items listed for review:
Contract: ABC Delivery Order Number: HTCH
Items reviewed:
Line 1, 10 EA, 000000000099784711, S01-004, 20070629063604.1_1
Line 2, 10 EA, 000000000088078625, 03356.63.04, 20070629063604.1_2
..where "1" maps to <Number>, "S01-004" maps to <Descr> and "20070629063604.1_1" maps to <Code>.
Keith,
Did u solved the issue? I'm not getting through it, since I'm not sure how ur input data will be, even though u gave two sample data above. If you haven't solved the issue, could you please give me the exact structure of the input data.
I want to know whetehr the data will be below format
<Test>Line 1, B67,B78,B88\nLine2,C67,C78,C88\nLine3,D67,D78,D88</Test>
or
<Test>Line 1, B67,B78,B88
Line2,C67,C78,C88
Line3,D67,D78,D88
</Test>
Please conirm it.
Best regards,
raj.
I have this working. Thanks everyone.
What really helped was the blog entitled "Mapping Context Changes in XI" that I found on SDN.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can use a UDF (type queue) that will export all the values to your XML target
inside this UDF just parse the string
you also need to put the rest of the values into global variable
and retrive them from two other UDFs
but it's pretty easy
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.