|
top
|
Subject: XML formatting for data file Author: Tony Lavinio Date: 30 Mar 2006 02:33 PM
|
I'm using Stylus Studio 2006 Release 2 XML Enterprise, which is
available here: http://www.stylusstudio.com/xml_download.html
This need to be done in two steps.
First, create a mapping that converts the sample.txt file into
XML. Second, use XSLT (or XQuery) to change that into the
exact structure you want for output.
First, do File|New|Convert to XML.
Choose your sample.txt file.
Change the following properties:
Delimiter Pairs from blank to '"','"'
Key=Value Character from blank to '='
Row Element Name from "row" to blank
Omit from Output from "Only when Empty" to "Never"
Use File|Save this as something like sample.conv.
Next, you can build your XSLT.
Choose File|New|XSLT: Mapper.
Click on "Add Source Document" and choose sample.txt.
Before clicking Open, put a check in the 'Use Adapter'
box and then choose sample.conv from the subsequent dialog.
Click on "Add Target Document" and choose a sample document
that matches the output you want - in your case,
CasualtyCertificate-V3.XML.
Now, build your map, which will generate your XSLT.
When you finish, you should have what you want.
|
|
|