簡單地址數據的範例

本範例描述了簡單地址數據,其中字段可能以不同次序顯示,這將取決於標記。通過基於標籤的匹配操作,“選擇”標記確定輸入行。

輸入範例

name: John & Paul
number: 07593 128912
street: 1 Cousins Drive
name: P J Baird
street: 24b The Hamptons
number: 07382 213 877

輸出範例

<addresses>
  <address>
    <name>John &amp; Paul</name>
    <number>07593 128912</number>
    <street>1 Cousins Drive</street>
  </address>
  <address>
    <name>P J Baird</name>
    <street>24b The Hamptons</street>
    <number>07382 213 877</number>
  </address>
</addresses>

架構

<?xml version='1.0'?>
<schema xmlns='http://www.infor.com/2017/TD/SSTransform/fsd/' version='1.0'>
  <sequence name="addresses">
    <sequence name="address" output="yes" max-occur="0" min-occur="0">
      <choice output="no" max-occur="3" min-occur="3">
        <record record-sep="\r\n" min-occur="1" output="no">
          <field name="name-label" min-length="6" max-length="6" valid-value="name: " output="no"/>
          <field name="name"/>
        </record>
        <record record-sep="\r\n" min-occur="1" output="no">
          <field name="addr-label" min-length="8" max-length="8" valid-value="street: " output="no"/>
          <field name="street"/>
        </record>
        <record record-sep="\r\n" min-occur="1" output="no">
          <field name="num-label" min-length="8" max-length="8" valid-value="number: " output="no"/>
          <field name="number"/>
        </record>
      </choice>
      <record name="blank-link" output="no" max-occur="1" min-occur="0" record-sep="\r\n">
        <field output="no"/>
      </record>
    </sequence>
  </sequence>
</schema>