|
SunSystems Transformation Language |
|
|
|
|
Sun Documentation -
System Administration
|
|
Page 2 of 11 Delimited Data Records and fields can have a separator specifier. This specifier delimits the record or field within the data. Where a delimiter is not specified, the data will be treated as fixed width, using the max-length attribute of the field element. The example below shows fields and records with separators. <?xml encoding=’UTF8’ version=’1.0’ ?> <fsd:schema xmlns:fsd='http://www.systemsunion.com/2001/SSTM/SSTransform/fsd/' version='1.0'> <fsd:sequence output=’no’> <fsd:record max-occur=’0’ name=’parent’ record-sep=’\r\n’> <fsd:field name=’child1’ field-sep=’,’/> <fsd:field name=’child2’/> </fsd:record> </fsd:sequence> </fsd:schema>Example FSD 2 - Records and Fields with Separators<parent> <child1/> <child2/> </parent>Example Output Structure 2
Below is shown an example input for this FSD together with the output that would be generated. Child 1 Data,Child 2 Data Child 3 Data,Child 4 Data Example Input Data 1 - Simple Delimited Data<parent> <child1>Child 1 Data</child1> <child2>Child 2 Data</child2> </parent> <parent> <child1>Child 3 Data</child1> <child2>Child 4 Data</child2> </parent>Example Output 3 - Simple Delimited DataThe FSD above marks each record as ending with a carriage-return line-feed pair (which is the standard end of line marker on Microsoft Operating Systems). It then defines two fields for each record. The first field uses the a comma as a delimiter; the second field is the last field in the record and therefore it uses the delimiter that was specified for the record as its own delimiter. |