logic needed to construct the xml

Hi All,

I have a requirement where I need to construct an xml by pulling the data from the database tables. The table has 2 fields ( eg: kit and sku).

It will have values like below:

[TABLE=“width: 96”]
[TR]
[TD=“width: 64, bgcolor: transparent”] kit[/TD]
[TD=“width: 64, bgcolor: transparent”] sku[/TD]
[/TR]
[TR]
[TD=“bgcolor: transparent, align: right”]1[/TD]
[TD=“bgcolor: transparent, align: right”]25[/TD]
[/TR]
[TR]
[TD=“bgcolor: transparent, align: right”]1[/TD]
[TD=“bgcolor: transparent, align: right”]26[/TD]
[/TR]
[TR]
[TD=“bgcolor: transparent, align: right”]1[/TD]
[TD=“bgcolor: transparent, align: right”]30[/TD]
[/TR]
[TR]
[TD=“bgcolor: transparent, align: right”]2[/TD]
[TD=“bgcolor: transparent, align: right”]34[/TD]
[/TR]
[TR]
[TD=“bgcolor: transparent, align: right”]2[/TD]
[TD=“bgcolor: transparent, align: right”]35[/TD]
[/TR]
[/TABLE]

Now, I have constructed the xml as below:

The xml looks like this

25


26


30


34


35

instead of this

25
26
30


34
35

Please let me know the logic how to take the “kit” in the table as primary value and loop over the document.

Thanks in advance.

You need to build a temp_test(document) with in the table results set(loop) and and map the attribute and B elements and append to orig_test (documentList) and make sure you drop the temp_test document so that it wont carry overwrite the data.When you outside of the loop finally the orig_test (documentList) should contain all kit/sku values and then create xmldata you know the service to use:

HTH,
RMG

Hi RMG,

Thank you for your response but if I use the same temp document and append it. I will not get the desired result.

My requirement is to different the unique values ( here kit ) and its corresponding sku values to be appended together.

As in my example below: I want the target xml to look like this

25 26 30 34 35

Not this way:
The xml looks like this [ This is when I create ]

25


26


30


34


35

Sorry, If I am not able to explain this issue properly. Is this something that can be accomplished by finding out the unique values for column1? or something that can be done usin Hash tables.

Hi David,

I have created the flow that give the out put same as you need …here is the flow…

Flow Overview
[ATTACH=CONFIG]894[/ATTACH]

please let me in case of any concerns…

wmuserTest.JPG

more details

2.1 Map doing nothing
2.211 map mapping Document1
Result Test1
Key to @key

and

pub.list:appendToStringList

Document1
Result Test1
value to value(string list)

2.212 map
pub.list:appendToDocumentList

Test1 to Document

2.222211 map

pub.list:appendToStringList

Document1
Result Document
value to value(string list)

2.222221 map mapping
Document1
Result Test1
Key to @key

and

pub.list:appendToStringList

Document1
Result Test1
value to value(string list)

2.223
pub.list:appendToDocumentList

Test1 to Document

Thanks so much…LifeforWM! Infact, I have achieved it by asking the DB team to populate the second set as a comma delimited when they store the values in the view so that I can simply tokenize on webMethods.

But thanks for your reply. Much appreciated.