Hi,
I would like to:
CSV to XML to Splitter to FileWriter
In the fileWriter stage I would like to name each file based on some content in the XML (i.e. some XPath). Looking at the userguide I am not easily seeing how to do this. Do I use XpathExtract? Do I use Enrich? I guess I don't understand how these stages work.
Could someone please post an example pipeline config that would
a) split an XML doc based on 'rowElement'
b) write each of these fragment docs to file with a file name based on, say, the 'eleAttrib' attribute of the element 'someEle'
?
Right now I can split my XML into fragment docs and email each of them, but in this case I needn't worry about assigning unique file names, let alone file names based on some xpath inside the docs.
Somewhat related: Is it possible to use 'xsl:document' in the xslt stage?
Thanks for any help,
Tim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The easiest way to do this is to use the XpathSplitter pipeline stage. This stage takes a xpath expression which should produce a set of nodes. Each of those nodes becomes a new document. So the XpathSplitter stage is a 1 doc in, many doc out stage. Then you extract the relevant node/values from the resulting documents using an XpathExtract stage. This will place the place the xpath extracted value on the document as an attribute. This attribute can then be accessed and used to construct the file name to write to disk.
regards,
Bruce.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I would like to:
CSV to XML to Splitter to FileWriter
In the fileWriter stage I would like to name each file based on some content in the XML (i.e. some XPath). Looking at the userguide I am not easily seeing how to do this. Do I use XpathExtract? Do I use Enrich? I guess I don't understand how these stages work.
Could someone please post an example pipeline config that would
a) split an XML doc based on 'rowElement'
b) write each of these fragment docs to file with a file name based on, say, the 'eleAttrib' attribute of the element 'someEle'
?
Right now I can split my XML into fragment docs and email each of them, but in this case I needn't worry about assigning unique file names, let alone file names based on some xpath inside the docs.
Somewhat related: Is it possible to use 'xsl:document' in the xslt stage?
Thanks for any help,
Tim
The easiest way to do this is to use the XpathSplitter pipeline stage. This stage takes a xpath expression which should produce a set of nodes. Each of those nodes becomes a new document. So the XpathSplitter stage is a 1 doc in, many doc out stage. Then you extract the relevant node/values from the resulting documents using an XpathExtract stage. This will place the place the xpath extracted value on the document as an attribute. This attribute can then be accessed and used to construct the file name to write to disk.
regards,
Bruce.