Subject:Convert linefeed-separated text file to nested XML Author:Brad Thacker Date:16 Jul 2008 12:22 PM
I just installed Stylus Studio and am attempting to use it to convert a file of linefeed-separated text records to nested XML. The structure of the initial text file looks like this:
and I need to convert it to a nested XML structure in which the level of nesting is determined by the first field in the pipe-delineated file. The output should look like this:
I read through Chapter 3 of the users manual that describes how to convert text to XML, but did not find any information that hinted at how to do this nesting. What I end up with is a flat structure:
Is it possible to use the tool set native to Stylus Studio to get the proper nesting, or do I need to perform an XSLT conversion on the flat XML structure above to get it?
I did find a set of XSLT conversion templates that can take the flat XML structure and convert it to the nested one, but I would prefer to do the complete transformation in one step, if possible.