| Author |
Flat file schema not validating correctly
|
|
| John Beavers 2004-10-15, 9:09 pm |
| I have a schema defined for a flat file that I want to populate a SQL table.
There are 3 positional field. For some reason when I validate the instance
the third field contains the entire file. Attached is my schema and a sample
from the flat file. Any help is greatly appreciated.
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Populate_ITMasterData.PartnerEquipment"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://Populate_ITMasterData.PartnerEquipment"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo count_positions_by_byte="false" standard="Flat File"
root_reference="Root" allow_early_termination="true"
parser_optimizaton="complexity" />
<schemaEditorExtension:schemaInfo namespaceAlias="b"
extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension"
standardName="Flat File"
xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"
sequence_number="1" child_order="infix" child_delimiter_type="hex"
child_delimiter="0x0D 0x0A" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="PE">
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number="1" structure="positional"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"
/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="EquipmentID" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left"
pos_length="18" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="PartnerID" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="2" justification="left"
pos_length="12" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="PartnerName" nillable="true" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="3" justification="left"
pos_length="40" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Sample file:
00000000001056206800027022 Gerard Rera
00000000001056222300007092 Jeffrey A Jones
00000000001056222400017909 Marguerite M Doyle
00000000001056222600028293 Leisa G Long
00000000001056222700011869 Sammie G Gordon
00000000001056223000025117 Gerald S Clayton
00000000001056223100003392 Michael R King
00000000001056223400029741 LaQuitta Washington Davis
00000000001056223600007376 Marcus J Waggoner
00000000001056223900032960 Derrill D Pruitt
Definition of sample file:
EquipmentID - 18
PartnerID - 12
PartnerName - 40
The PartnerName may terminate early..
| |
| Nabeel Prior 2004-10-15, 9:09 pm |
| Set the MaxOccurs property on the PE node to * (unbounded)
Kind Regards,
Nabeel Prior
2004/10/12 15:35:04
John Beavers <JohnBeavers@discussions.microsoft.com> wrote in message
<515DB8DC-D1B3-4322-A452-BA6A6E7B5FB1@microsoft.com>
> I have a schema defined for a flat file that I want to populate a
SQL table.
> There are 3 positional field. For some reason when I validate the
instance
> the third field contains the entire file. Attached is my schema and
a sample
> from the flat file. Any help is greatly appreciated.
>
> <?xml version="1.0" encoding="utf-16"?>
> <xs:schema xmlns="http://Populate_ITMasterData.PartnerEquipment"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://Populate_ITMasterData.PartnerEquipment"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:annotation>
> <xs:appinfo>
> <b:schemaInfo count_positions_by_byte="false" standard="Flat
File"
> root_reference="Root" allow_early_termination="true"
> parser_optimizaton="complexity" />
> <schemaEditorExtension:schemaInfo namespaceAlias="b"
> extensionClass="Microsoft.BizTalk.FlatFileExtension.
FlatFileExtension"
> standardName="Flat File"
> xmlns:schemaEditorExtension="http://schemas.microsoft.
com/BizTalk/2003/SchemaEditorExtensions" />
> </xs:appinfo>
> </xs:annotation>
> <xs:element name="Root">
> <xs:annotation>
> <xs:appinfo>
> <b:recordInfo structure="delimited"
> preserve_delimiter_for_empty_data="true"
suppress_trailing_delimiters="false"
> sequence_number="1" child_order="infix" child_delimiter_type="hex"
> child_delimiter="0x0D 0x0A" />
> </xs:appinfo>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence>
> <xs:annotation>
> <xs:appinfo>
> <b:groupInfo sequence_number="0" />
> </xs:appinfo>
> </xs:annotation>
> <xs:element name="PE">
> <xs:annotation>
> <xs:appinfo>
> <b:recordInfo sequence_number="1"
structure="positional"
> preserve_delimiter_for_empty_data="true"
suppress_trailing_delimiters="false"
> />
> </xs:appinfo>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence>
> <xs:annotation>
> <xs:appinfo>
> <b:groupInfo sequence_number="0" />
> </xs:appinfo>
> </xs:annotation>
> <xs:element name="EquipmentID" type="xs:string">
> <xs:annotation>
> <xs:appinfo>
> <b:fieldInfo sequence_number="1"
justification="left"
> pos_length="18" />
> </xs:appinfo>
> </xs:annotation>
> </xs:element>
> <xs:element name="PartnerID" type="xs:string">
> <xs:annotation>
> <xs:appinfo>
> <b:fieldInfo sequence_number="2"
justification="left"
> pos_length="12" />
> </xs:appinfo>
> </xs:annotation>
> </xs:element>
> <xs:element name="PartnerName" nillable="true"
type="xs:string">
> <xs:annotation>
> <xs:appinfo>
> <b:fieldInfo sequence_number="3"
justification="left"
> pos_length="40" />
> </xs:appinfo>
> </xs:annotation>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
>
>
> Sample file:
>
> 00000000001056206800027022 Gerard Rera
> 00000000001056222300007092 Jeffrey A Jones
> 00000000001056222400017909 Marguerite M Doyle
> 00000000001056222600028293 Leisa G Long
> 00000000001056222700011869 Sammie G Gordon
> 00000000001056223000025117 Gerald S Clayton
> 00000000001056223100003392 Michael R King
> 00000000001056223400029741 LaQuitta Washington Davis
> 00000000001056223600007376 Marcus J Waggoner
> 00000000001056223900032960 Derrill D Pruitt
>
> Definition of sample file:
> EquipmentID - 18
> PartnerID - 12
> PartnerName - 40
>
> The PartnerName may terminate early..
| |
| John Beavers 2004-10-15, 9:09 pm |
| The problem that I am having is that it reads the first and second fields
fine, however the third field contains the rest of the file. I have since
gone back and removed the PE node. This has not solved my problem. Any
suggestions?
"Nabeel Prior" wrote:
> Set the MaxOccurs property on the PE node to * (unbounded)
> Kind Regards,
>
> Nabeel Prior
>
> 2004/10/12 15:35:04
> John Beavers <JohnBeavers@discussions.microsoft.com> wrote in message
> <515DB8DC-D1B3-4322-A452-BA6A6E7B5FB1@microsoft.com>
>
> SQL table.
> instance
> a sample
> File"
> FlatFileExtension"
> com/BizTalk/2003/SchemaEditorExtensions" />
> suppress_trailing_delimiters="false"
> structure="positional"
> suppress_trailing_delimiters="false"
> justification="left"
> justification="left"
> type="xs:string">
> justification="left"
>
| |
| John Beavers 2004-10-15, 9:09 pm |
| I have also made the following change to the schema
<?xml version="1.0" encoding="utf-16" ?>
- <xs:schema xmlns="http://Populate_ITMasterData.PartnerEquipment"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://Populate_ITMasterData.PartnerEquipment"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:annotation>
- <xs:appinfo>
<b:schemaInfo count_positions_by_byte="false" standard="Flat File"
root_reference="Root" allow_early_termination="true"
parser_optimizaton="complexity" child_delimiter_type="hex"
default_child_delimiter="0x0D 0x0A" default_child_order="infix"
wrap_char_type="hex" default_wrap_char="0x0D" />
<schemaEditorExtension:schemaInfo namespaceAlias="b"
extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension"
standardName="Flat File"
xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
</xs:appinfo>
</xs:annotation>
- <xs:element name="Root">
- <xs:annotation>
- <xs:appinfo>
<b:recordInfo structure="positional"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"
sequence_number="1" child_order="infix" child_delimiter_type="hex"
child_delimiter="0x0D 0x0A" />
</xs:appinfo>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:annotation>
- <xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
- <xs:element name="EquipmentID" type="xs:string">
- <xs:annotation>
- <xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left" pos_length="18" />
</xs:appinfo>
</xs:annotation>
</xs:element>
- <xs:element name="PartnerID" type="xs:string">
- <xs:annotation>
- <xs:appinfo>
<b:fieldInfo sequence_number="2" justification="left" pos_length="12" />
</xs:appinfo>
</xs:annotation>
</xs:element>
- <xs:element name="PartnerName" type="xs:string">
- <xs:annotation>
- <xs:appinfo>
<b:fieldInfo sequence_number="3" justification="left" pos_length="40" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
"John Beavers" wrote:
[vbcol=seagreen]
> The problem that I am having is that it reads the first and second fields
> fine, however the third field contains the rest of the file. I have since
> gone back and removed the PE node. This has not solved my problem. Any
> suggestions?
>
> "Nabeel Prior" wrote:
>
|
|
|
|