Mapping Issue - filtering items from documentlist

I have gone thru the postings in the forum and still not able to figure out the issue. I am not able to map values to tempPersonalInfo. Can someone please review my code and let me know what I am missing here? I am stuck on my developer exploration due to this.
AK (10.2 KB)


Sorry pl ignore my post…you are right response is for a different posting…

Not sure if you posted the response to the right message.
I am not using SMTP. To mimic the issue I am facing - I created a sample XML file which I am parsing and trying to filter out the list created. Would appreciate if you could review the code attached and let me know if I am missing anything here. Any help is highly appreciate as I am stuck and not able to proceed on this.

There are several issues I see:

  • You need another document type to define the contents of your sample file. The doc type you have defines the records, but not the file. The new doc type should have a top-level document list named PersonalInfo.

  • When calling xmlNodeToDocument, specify the new doc type above in the documentTypeName parameter. This will ensure that things that are supposed to be lists are created as lists. Without this, you get a single string for “personalDetails” and not a list when only one string is available in the file. And any loop attempt over this will fail.

  • You’re dropping PersonalInfoList within the loop. This will cause the loop to fail.

  • Your branch step is using “Evaluate labels = True” which is actually okay, but instead you could branch on PersonalInfoList/PersonaInfo/personalDetails, set evaluate labels to false and set the label of the sequence to /programmer/.

  • You’re not conditionally doing the last map step. It looks like you did at one point, since the label is set with an expression. But there is no branch step within scope at that point so the label is ignored.

  • The last map step creates a new list on every iteration, replacing the previous list. You need to keep a variable that is the target list and pass it in as the toList input.

  • In the last step, here again you’re using a label expression when it is not necessary. Just branch on isProgrammer, set evaluate labels to false, and set the label on the map step to true. This is a more readable construct.

Good luck.

Here’s an updated version of the package that does the job. (7.41 KB)

Thanks Rob!! Very much appreciate your enthusiasm for a detailed review of my package. In the times of “do more with less time” - no body has time and patience to provide the detailed feedback. I am sure your response is going to help lots of newbies like me in the years to come. Whatever WM I have learnt - it is by going thru WMSamples and WMUsers forum(from 2002) - I am thankful for all the people like you helping newbies like me get upto speed. Your comments exposed me to new ideas. There were a quiet a few posts on this topic but I was not able to understand it very well. You solution made it crystal clear!!
Hopefully one day, I will be able to give back the WM knowledge I have gained from this forum - to the members of this forum!!