我必须做从平面文件到 xml 的转换,但问题是平面文件有多个子节点,子节点也有子节点。记录在文件中多次出现。我创建了一个模式,但它只处理单个记录。你能告诉我我应该创建可以处理多条记录的模式的结构吗?
这是平面文件。
ASN,000589,,0000768,
HDR,0008289,0040294A,LA,00,1570,21,TM,,,M,PE,Corporation,120276,052451,05-00289,05-08299,02,LA,B,011,C,BD ,8,LA,16570,24,ST,,N,GETRO,GETRO,120246,054551,LA,0000568,8018279,
POH,0508289,004024A,1,PPO000199,LA,NP,00,13615,13563,13414,1351,2584,,3598,2900,,,A200,B200,HN,18552,1270,,N,GETRO,GETRO,1206,05451,LA,0000768,
LNE,0005289,00402929 ,1,1,PPO000099,AP,00,8719,00704,2536,DW,3870,DW,CC,0930-01,05-08289,,N,GETRO,GETRO,13246,05751,LA,00005668,2,
PCK,A0722,4786149,100,2536,LA,
LNE,0005089,0040294A ,2,1,PPO0000199,OP,00,82664,001822,890,HW,3500,HW,CC,0656-01,05-08289,,N,GETRO,GETRO,120246,054551,LA,000052768,4,
PCK,031992,48005,12,8290,LA,
LNE,0005289,004029A ,2,2,PPO0000199,AP,00,872087,0000859,5744,HN,367500,HW,CD,098656-02,05-08289,,N,GETRO,GETRO,120246,054551,LA,00005768,3,
PCK,04022,479782,100,2872,LA,
PCK,04023,4797288,100,2872,LA,
ASN,000521288,004679294A,000075667,
HDR,000788288,004024594A,LA,00,33758,01,TM,,,M,PP,Corporation,120246,054551,05-08289,05-08289,01,LA,B,011,C,BA ,8,LA,33158,24,ST,,N,GETRO,GETRO,120246,054551,LA,000672767,8056279,
POH,000508288,004029294A,1,PPO000000199,LA,AP,00,1360415,1350063,1346914,13501,258304,,35698,2900,,,D250,D290,HQ,10352,33158,,N,GETRO,GETRO,120246,054551,LA,000052767,
LNE,0005288,0040294A ,1,2,PPO0000199,OP,00,874402,30001281,33158,HA,377500,HA,CC,098630-02,05-08289,,N,GETRO,GETRO,120246,054551,LA,00002767,1,
PCK,03134,480075,12,8290,LA,
PCK,03114,480076,12,8290,LA,
PCK,94985,480579,12,8290,LA,
PCK,94995,480080,12,8290,LA,
这是我创建的架构
<?xml version="1.0" encoding="UTF-16"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://Test.InputSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Test.InputSchema">
-<xs:annotation>
-<xs:appinfo>
<schemaEditorExtension:schemaInfo xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" standardName="Flat File" extensionClass="Microsoft.Azure.Integration.DesignTools.FlatFileExtension.FlatFileExtension" namespaceAlias="b"/>
<b:schemaInfo root_reference="Root" default_child_order="infix" default_child_delimiter="," child_delimiter_type="char" compile_parse_tables="false" allow_message_breakup_of_infix_root="false" early_terminate_optional_fields="false" allow_early_termination="false" generate_empty_nodes="true" suppress_empty_nodes="false" lookahead_depth="3" parser_optimization="speed" count_positions_by_byte="false" pad_char_type="char" default_pad_char=" " codepage="65001" standard="Flat File"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="Root">
-<xs:annotation>
-<xs:appinfo>
<b:recordInfo child_delimiter_type="hex" suppress_trailing_delimiters="false" preserve_delimiter_for_empty_data="true" sequence_number="1" child_order="postfix" child_delimiter="0x0D 0x0A" structure="delimited"/>
</xs:appinfo>
</xs:annotation>
-<xs:complexType>
-<xs:sequence>
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="0"/>
</xs:appinfo>
</xs:annotation>
-<xs:sequence maxOccurs="unbounded">
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="1"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="ASN">
-<xs:annotation>
-<xs:appinfo>
<b:recordInfo child_delimiter_type="default" suppress_trailing_delimiters="false" preserve_delimiter_for_empty_data="true" sequence_number="1" child_order="default" structure="delimited" tag_name="ASN,"/>
</xs:appinfo>
</xs:annotation>
-<xs:complexType>
-<xs:sequence>
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="0"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="Field" maxOccurs="unbounded" type="xs:string">
-<xs:annotation>
-<xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left"/>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
-<xs:element name="HDR">
-<xs:annotation>
-<xs:appinfo>
<b:recordInfo child_delimiter_type="default" suppress_trailing_delimiters="false" preserve_delimiter_for_empty_data="true" sequence_number="2" child_order="default" structure="delimited" tag_name="HDR,"/>
</xs:appinfo>
</xs:annotation>
-<xs:complexType>
-<xs:sequence>
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="0"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="Field" maxOccurs="unbounded" type="xs:string">
-<xs:annotation>
-<xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left"/>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
-<xs:element name="POH">
-<xs:annotation>
-<xs:appinfo>
<b:recordInfo child_delimiter_type="default" suppress_trailing_delimiters="false" preserve_delimiter_for_empty_data="true" sequence_number="3" child_order="default" structure="delimited" tag_name="POH,"/>
</xs:appinfo>
</xs:annotation>
-<xs:complexType>
-<xs:sequence>
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="0"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="Field" maxOccurs="unbounded" type="xs:string">
-<xs:annotation>
-<xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left"/>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
-<xs:sequence maxOccurs="unbounded">
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="4"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="LNE" maxOccurs="unbounded">
-<xs:annotation>
-<xs:appinfo>
<b:recordInfo child_delimiter_type="default" suppress_trailing_delimiters="false" preserve_delimiter_for_empty_data="true" sequence_number="1" child_order="default" structure="delimited" tag_name="LNE,"/>
</xs:appinfo>
</xs:annotation>
-<xs:complexType>
-<xs:sequence>
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="0"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="Field" maxOccurs="unbounded" type="xs:string">
-<xs:annotation>
-<xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left"/>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
-<xs:element name="PCK">
-<xs:annotation>
-<xs:appinfo>
<b:recordInfo child_delimiter_type="default" suppress_trailing_delimiters="false" preserve_delimiter_for_empty_data="true" sequence_number="2" child_order="default" structure="delimited" tag_name="PCK,"/>
</xs:appinfo>
</xs:annotation>
-<xs:complexType>
-<xs:sequence>
-<xs:annotation>
-<xs:appinfo>
<b:groupInfo sequence_number="0"/>
</xs:appinfo>
</xs:annotation>
-<xs:element name="Field" maxOccurs="unbounded" type="xs:string">
-<xs:annotation>
-<xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left"/>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>