09-23-2020 03:45 PM
I’m formatting and writing an xml file, and would like to name the file based on a field value from the original file, but cannot be part of the xml. Is it possible to somehow bring a variable ($VAR) from a prior step in to the File Writer without including it in the preceeding XML?
‘response-s-’$VAR’+‘-.xml’
Solved! Go to Solution.
09-23-2020 10:57 PM
@acesario You can segregate xml format and file writer in different pipeline, then call this child pipeline using Pipeline execute and pass input param(the filename you want ) from your parent pipeline. Even if you use xsd inside xml format, you can found the xsd structure from the mapper(Map to xml) of your parent pipeline.
09-23-2020 10:57 PM
@acesario You can segregate xml format and file writer in different pipeline, then call this child pipeline using Pipeline execute and pass input param(the filename you want ) from your parent pipeline. Even if you use xsd inside xml format, you can found the xsd structure from the mapper(Map to xml) of your parent pipeline.
09-24-2020 04:58 AM
@Supratim Thanks for the quick response! I actually had tried using a separate pipeline, and was able to pass the parm as you suggest, however my xml output would be one row, rather than the aggregated rows. So, a. I was doing this before the map to xml. I could try it after that.
Or better yet, b. Is there a way to have sub pipeline produce the aggregated rows, just like the parent does?
What I mean is, Parent produces xml:
<#root>
<#row1>
<#row2>
<#row3>
<#/root
…
Child (sub) currently produces
file1…
<#root>
<#row>
<#/root>
file 2…
<#root>
<#row>
<#/root>
file 3…
<#root>
<#row>
<#/root>
09-24-2020 06:02 AM
Actually you pass each row from pipeline execution snap, Move mapper to child pipeline , it should work.
Unless the upstream snap of mapper produce multiple output of row.
09-24-2020 06:17 AM
Yes, the upstream snap produces multiple rows.