BizTalk Server General - trailing delimiter

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > February 2005 > trailing delimiter





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author trailing delimiter
H

2005-02-10, 8:47 pm

Hi,

Q: is there a way to set the schema that can validate a flat file regardless
if the file end delimiter (LF, CR) is presented or not.

-H
David Regan

2005-02-14, 5:50 pm

One way to achieve this to configure a trailer schema in the flat file
disassembler. The trailer schema is simply there to consume any trailing
CR/LFs.

Here's a sample schema:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://ConsumeCrLfSchema"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://ConsumeCrLfSchema"
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 document_type="ConsumeCrLf" version="1.0"
count_positions_by_byte="false" standard="Flat File"
root_reference="ConsumeCrlf" />
</xs:appinfo>
</xs:annotation>
<xs:element name="ConsumeCrlf">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"
sequence_number="1" child_delimiter_type="hex" child_order="infix"
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="Field1" 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:schema>

Hope that helps.

"H" wrote:

> Hi,
>
> Q: is there a way to set the schema that can validate a flat file regardless
> if the file end delimiter (LF, CR) is presented or not.
>
> -H

H

2005-02-15, 8:51 pm

I tried with following schema and take your sample as the trailer schema in
the pipeline, it still failed on the FF schema vaildation.

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Trailer.Schemas.main"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://Trailer.Schemas.main"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo count_positions_by_byte="false" standard="Flat File"
root_reference="ContactInfo" />
<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="ContactInfo">
<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 minOccurs="0" maxOccurs="unbounded" name="Contact">
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number="1" structure="delimited"
preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"
child_delimiter_type="char" child_order="infix" child_delimiter="|" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Name" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="1" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Age" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="2" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Address" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="3" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="City" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="4" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="State" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="5" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="County" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="6" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Country" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number="7" justification="left" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com