cancel
Showing results for 
Search instead for 
Did you mean: 

Stringlist to XML

Former Member
0 Kudos

Hi,

Can somebody explain how to convert a comma delimited stringlist into an XML format consisting of 2 columns and unknown number of rows? I don't want 1 row per item but need to repeat the rows.

Regards,

Chanti.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Perhaps a sample of your input and your desired output would be helpful. Are you wanting to make pairs of the values? For instance turning


Value1,Value2,Value3,Value4,Value5,Value6

into (spaces denote columns)


Value1   Value2
Value3   Value4
Value5   Value6

Is that what you are looking for?

Former Member
0 Kudos

Yes, thats exactly what I am looking for.

jamie_cawley
Advisor
Advisor
0 Kudos

Depening on where the data is coming from this may help

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30472799-604b-2b10-d4bf-d7498b027...

or you just need to use the stringlisttoxml action and define a mii doc with the two columns, repeat on the stringlisttoxml results, every old row use the row action, then you need define the logic to determine what column to enter the data in, then assign it using the data item action.

Jamie

Former Member
0 Kudos

What would be a simple logic in the case of 2 columns?

jamie_cawley
Advisor
Advisor
0 Kudos

I guess if you don't have a specific condition, I would just place the one data item under the add row action on the true branch of a conditional with the following input

yourloop.CurrentItem % 2

the false branch would just need the data item. I would also add an additional input on the conditional to test the last item. If it's odd you would want to enter the false branch again to complete your doc.

Jamie

Edited by: Jamie Cawley on Feb 11, 2010 3:19 PM

Former Member
0 Kudos

It worked, but I would like them to be paired like the below pattern -

Name1 Value1

Name2 Value2

Name3 Value3

...

I don't want like this

Name1 <space>

<space> Value1

Name2 <space>

<space> Value2

Name3 <space>

<space> Value3

...

Edited by: CKxMII on Feb 11, 2010 9:38 PM

jamie_cawley
Advisor
Advisor
0 Kudos

Make sure you only have the row action on the true branch. Both sides need the data item.

Disregard what I said about an additional input to check the last item, you will need an additional conditional to do this.

Jamie

Former Member
0 Kudos

I don't follow what you are saying. Heres my input -

Name1 Value1 Name2 Value2 Name3 Value3...

I need the output like this -

Name Value

Row1 Name1 Value1

Row2 Name2 Value2

Row3 Name3 Value3

...

The way I am getting it now is -

Row1 Name1 <space>

Row2 <space> Value1

Row3 Name2 <space>

Row4 <space> Value2

Row5 Name3 <space>

Row6 <space> Value3

...

I am not able to show the white space in the front since its getting trimmed. I can cut and paste the results. But I don't know how to do it.

Edited by: CKxMII on Feb 11, 2010 10:58 PM

jamie_cawley
Advisor
Advisor
0 Kudos

Here's an example.

Jamie

Answers (0)