我得到一个平面文件,其中几个位置数据将在同一行中以相同的顺序重复。例如 -
country name first name last name first name last name first name last name ......
India A B C D E F
正如您所看到的,名字和姓氏将重复n次。由于这是平面文件,所有数据都带有位置,并且随着重复数据的到来N个时间我不知道该行的总长度是多少。我已经设法创建xsd但是我遇到错误,因为它进入无限循环。
平面文件 -
India A B C D E F
XSD -
<xsd:element name="Header" maxOccurs="unbounded" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="country"
nxsd:style="fixedLength"
nxsd:padStyle="head"
nxsd:paddedBy=" "
nxsd:length="10"
minOccurs="0"
type="xsd:string"/>
<xsd:element name="FirstName"
type="xsd:string"
nxsd:style="fixedLength"
nxsd:padStyle="head"
nxsd:paddedBy=" "
nxsd:length="14"
minOccurs="0"/>
<xsd:element name="LastName"
type="xsd:string"
nxsd:style="fixedLength"
nxsd:padStyle="head"
nxsd:paddedBy=" "
nxsd:length="14"
minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
我知道我没有使用terminateBy函数,因为它进入了无限循环,但我不知道文件中存在的firstname和lastname的数量。
如何解决这个问题?你能帮帮我吗?