Syndicate
Home arrow Sun Documentation arrow System Administration arrow SunSystems Transformation Language
SunSystems Transformation Language PDF Print E-mail
User Rating: / 0
PoorBest 
Sun Documentation - System Administration
Article Index
SunSystems Transformation Language
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8
Page 9
Page 10
Page 11

Example 2
This example describes simple address data, where the fields can appear in a different order depending on their label.  The choice tag is used to determine the input line by using doing a match based on the label.
Example Input
name: John & Paul
number: 07953 128912
street: 1 Cousins Drive
name: P J Baird
street: 24b The Hamptons
number: 07832 213 877
Example Output
<addresses>
  <address>
     <name>John &amp; Paul</name>
     <number>07953 128912</number>
     <street>1 Cousins Drive</street>
  </address>
  <address>
     <name>P J Baird</name>
     <street>24b The Hamptons</street>
      <number>07832 213 877</number>
  </address>
</addresses>
Schema
<?xml version='1.0'?>
<fsd:schema xmlns:fsd='http://www.systemsunion.com/2001/SSTM/SSTransform/fsd/' version='1.0'>
 <fsd:sequence name="addresses">
  <fsd:sequence
name="address" output="yes" max-occur="0" min-occur="0">
   <fsd:choice
output="no"
max-occur="3" min-occur="3">
    <fsd:record record-sep="\r\n" min-occur="1" output="no">  
<fsd:field name="name-label" 
          min-length="6" 
          max-length="6" 
          valid-value="name: " 
          output="no"/>
     <fsd:field name="name"/>
    </fsd:record>
    <fsd:record record-sep="\r\n"
          min-occur="1" output="no">
 <fsd:field name="addr-label"
          min-length="8" 
          max-length="8" 
          valid-value="street: " 
          output="no"/>
     <fsd:field name="street"/>
    </fsd:record>
    <fsd:record record-sep="\r\n"
         min-occur="1" output="no">
     <fsd:field name="num-label" 
          min-length="8" 
          max-length="8" 
          valid-value="number: " 
          output="no"/>
     <fsd:field name="number"/>
    </fsd:record>
   </fsd:choice>
   <fsd:record name="blank-line"
output="no" max-occur="1"
min-occur="0" record-sep="\r\n">
    <fsd:field output="no"/>
   </fsd:record>
  </fsd:sequence>
 </fsd:sequence>
</fsd:schema>

Comments

Only registered users can write comments.
Please login or register.




Latest News
Forum Topics
Latest Articles
 
 
Popular Articles
Poll
Apart from Sun do you use other Infor products?
Yes, we use these Infor products: