Loop over all fields

Hi All! This is my firts post. I’M working with webMethods since just a few weeks.

Here is my question:

Is there a way to loop over all fields of an XML document? I want to trim all fields, and the only method I can see is to manually apply a trim function on each field.

Thanks!

If you are manipulating XML document you will definitely be looping over the document. It is a good idea to have trim function as a transformer for all fields to minimize processing time in single map step. I am not sure we have any other options.

Be careful about equating the number of steps to processing efficiency.
Invoke vs. transformer
Efficiency of transformers

I vaguely recall a thread about traversing an IData document (visiting every field all the way down the structure) and performing an action, such as trim. I can’t seem to find it now but maybe my mentioning it will trigger someone’s memory. If not, you should be able to create a Java service that will traverse an arbitrary IData object using recursion. You’ll want to make sure you call trim only on nodes that are strings.

Believe writing a Java service should be fine & easy.

My 0.02.

HTH
Malhar