我有一个相当简单的平面文件模式,它只生成 CSV,或者至少它应该生成。它有一个由 CRLF 分隔的 Root 节点,然后是一个由逗号分隔的 Record 节点,然后是其下的实际字段。
<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://My.Namespace" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://My.Namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
<b:schemaInfo standard="Flat File" codepage="65001" default_pad_char="" pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Root" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Record">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" default="" name="TheFirstField" nillable="true" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<!-- And more fields here -->
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
当我在此架构上执行生成实例时,我得到一个只有逗号的文件,这表明它至少在某种程度上适合创建 CSV。但是,当我将此模式作为映射的输出类型时,从 XML 文件的输入类型,我做一个测试映射,我得到这个:
Invoking component...
TestMap used the following file: <file:///C:\path\to\test.xml> as input to the map.
C:\path\to\output.xml: error btm1046: Output validation error: The element 'Root' in namespace 'http://My.Namespace' has invalid child element 'Record'.
Test Map failure for map file <file:///C:\path\to\my\Map.btm>. The output is stored in the following file: <file:///C:\path\to\output.txt>
Component invocation succeeded.
output.txt 文件最终不会被创建。
使用平面文件输出测试地图时出现此错误的原因是什么,我该如何解决?