0
votes

I have some 20k xml files in a path. I wanna access only one file at a item like a queue for XML stax step, not for XML input step. Is there any option to get one file at a time, process it and then go for next file. Example: like a for each loop.

2

2 Answers

1
votes

You should use a job with two sub-transformations.

The first transformation has one “get file names” step followed by “copy rows to result”.

The parent job sets 2nd transformation to run for each input row and map the filename step from ktr 1 to filename parameter of ktr 2.

2nd transformation has a parameter filename, that is used to define which file to read with StaX parser.

0
votes

You can Get the files names and give the result toe the Get data form XML, with the option XML source is define in a field.

One transformation with two steps, and automagically parallel. But if your solution needs to be scalable (more than just reading a item and writing it somewhere), I suggest you use nsouza's solution. In case an error happens, you'll have a chance to know which file is the guilty.