Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Flat File Assembler FFAsm issue?
- This topic has 3 replies, 1 voice, and was last updated 9 years, 5 months ago by
community-content.
-
AuthorPosts
-
-
August 16, 2006 at 2:29 PM #15320
Hello,
I am facing this strange problem with FFASM tool.
I have a Flat file schema xsd which is given below and i have an input
xml instance.
In the schema, i have an eDate element which may not be present in the
input xml instance.
Now, the requirement is that if eDate is not present in the input, it
should just output emptystring. basically the eDate node must be
present in the flat file output.
in my input instance there is no eDate element. Another element genDate
appears after eDate in the XSD.
i run the FFASM.exe tool (C:\\Program Files\\Microsoft BizTalk Server
2006\\SDK\\Utilities\\PipelineTools) at the command prompt with the follo
options:ffasm Test3.xml -bs TestSchema.xsd -c -v
Test3.xml being the input xml and the TestSchema.xsd being the flat
file schema.Now if the genDate element appears after eDate, it generates the Flat
file fine..i mean i get a eDate node (empty) before the genDate.
However if i decide that eDate should appear after genDate in the
output flat file and i swap the two elements in the xsd, the empty node
does not appear at all !!
What happens when i swap the positions of eDate and genDate?
Please helpRegards,
BMThe input instance Test3.xml is as follows:
<ns0:TT
xmlns:ns0=\”http://Test.TestSchema\”><ns0:Header><ns0:RecordType>H</ns0:RecordType><ns0:CreatedDate>2006-08-16%u00adT12:52:58</ns0:CreatedDate></ns0:
Header><ns0:Address><ns0:RecordType>A</ns0:RecordType><ns0:UserSerialNumber%u00ad>dd</ns0:UserSerialNumber></ns0:Address><ns0:GridData><ns0:RecordT
ype>G</ns0:RecordType><ns0:SerialNumber>dd</ns0:SerialNumber><ns0:genDate>2%u00ad006-07-10T10:20:37+0100</ns0:genDate><ns0:GridValue><ns0:RowNum>1<
/ns0:RowNum></ns0:GridValue><ns0:GridValue><ns0:RowNum>1</ns0:RowNum></ns0:%u00adGridValue></ns0:GridData><ns0:Trailer><ns0:RecordType>T</ns0:Recor
dType><ns0:TotalNumberOfRecords>4</ns0:TotalNumberOfRecords></ns0:Trailer><%u00ad/ns0:TT>The TestSchema XSD is pasted below:
<?xml version=\”1.0\” encoding=\”utf-16\”?>
<xs:schema xmlns:b=\”http://schemas.microsoft.com/BizTalk/2003\”
xmlns=\”http://Test.TestSchema\” elementFormDefault=\”qualified\”
targetNamespace=\”http://Test.TestSchema\”
xmlns:xs=\”http://www.w3.org/2001/XMLSchema\”>
<xs:annotation>
<xs:appinfo>
<b:schemaInfo 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\” standard=\”Flat File\” root_reference=\”TT\”/>
<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=\”TT\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure=\”delimited\”
preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” sequence_number=\”1\”
rootTypeName=\”TT\” 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=\”1\” maxOccurs=\”1\” name=\”Header\”>
<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_delimiter=\”,\” child_order=\”infix\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”H\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”CreatedDate\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:sequence minOccurs=\”0\” maxOccurs=\”unbounded\”>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”2\” />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs=\”0\” maxOccurs=\”unbounded\”
name=\”Address\”>
<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=\”,\” tag_name=\”A\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”A\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=\”left\”
sequence_number=\”1\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”UserSerialNumber\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element default=\” \” name=\”UserName\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”3\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs=\”0\” maxOccurs=\”unbounded\”
name=\”GridData\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number=\”2\” structure=\”delimited\”
preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” child_order=\”infix\”
child_delimiter_type=\”char\” child_delimiter=\”,\” tag_name=\”G\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”G\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”SerialNumber\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element default=\” \” name=\”eDate\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”3\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”genDate\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”4\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs=\”0\” maxOccurs=\”unbounded\”
name=\”GridValue\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number=\”5\”
structure=\”delimited\” preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” child_order=\”infix\”
child_delimiter_type=\”char\” 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=\”RowNum\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:element minOccurs=\”1\” maxOccurs=\”1\” name=\”Trailer\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number=\”3\” structure=\”delimited\”
preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” child_delimiter_type=\”char\”
child_delimiter=\”,\” child_order=\”infix\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”T\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”TotalNumberOfRecords\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> -
August 17, 2006 at 4:48 AM #15321
Hello Greg, thanks for the reply. However, For the Address record, the last field UserName is optional but still it generates a empty node. Any idea why?
Regards,
Biju
The TestSchema XSD is pasted below:
<?xml version=\”1.0\” encoding=\”utf-16\”?>
<xs:schema xmlns:b=\”http://schemas.microsoft.com/BizTalk/2003\”
xmlns=\”http://Test.TestSchema\” elementFormDefault=\”qualified\”
targetNamespace=\”http://Test.TestSchema\”
xmlns:xs=\”http://www.w3.org/2001/XMLSchema\”>
<xs:annotation>
<xs:appinfo>
<b:schemaInfo 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\” standard=\”Flat File\” root_reference=\”TT\”/>
<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=\”TT\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure=\”delimited\”
preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” sequence_number=\”1\”
rootTypeName=\”TT\” 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=\”1\” maxOccurs=\”1\” name=\”Header\”>
<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_delimiter=\”,\” child_order=\”infix\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”H\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”CreatedDate\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:sequence minOccurs=\”0\” maxOccurs=\”unbounded\”>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”2\” />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs=\”0\” maxOccurs=\”unbounded\”
name=\”Address\”>
<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=\”,\” tag_name=\”A\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”A\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=\”left\”
sequence_number=\”1\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”UserSerialNumber\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element default=\” \” name=\”UserName\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”3\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs=\”0\” maxOccurs=\”unbounded\”
name=\”GridData\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number=\”2\” structure=\”delimited\”
preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” child_order=\”infix\”
child_delimiter_type=\”char\” child_delimiter=\”,\” tag_name=\”G\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”G\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”SerialNumber\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element default=\” \” name=\”eDate\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”3\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”genDate\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”4\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs=\”0\” maxOccurs=\”unbounded\”
name=\”GridValue\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number=\”5\”
structure=\”delimited\” preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” child_order=\”infix\”
child_delimiter_type=\”char\” 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=\”RowNum\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:element minOccurs=\”1\” maxOccurs=\”1\” name=\”Trailer\”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number=\”3\” structure=\”delimited\”
preserve_delimiter_for_empty_data=\”true\”
suppress_trailing_delimiters=\”false\” child_delimiter_type=\”char\”
child_delimiter=\”,\” child_order=\”infix\” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=\”0\” />
</xs:appinfo>
</xs:annotation>
<xs:element default=\”T\” name=\”RecordType\”
type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”1\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=\”TotalNumberOfRecords\” type=\”xs:string\”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=\”2\”
justification=\”left\” wrap_char_type=\”hex\” wrap_char=\”0x22\” />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>-
August 16, 2006 at 9:39 PM #15322
There is only part of your schema, so this is a bit of a guess.
I assumed your Schema looks like this:
[code:1:6b430db73b]TT
Header
Address
GridData Delimiter \",\" Infix
RecordType
SerialNumber
genDate
eDate
GridValue
RowNum
Trailer[/code:1:6b430db73b]
Because the eDate field is the last field of the GridData record, there is no trailing delimiter. Therefore if eDate has no value there will be no empty node.One way of fixing this is to change the schema structure to:
[code:1:6b430db73b]TT
Header
Address
GridLine – no delimiter
GridData Delimiter \",\" Infix
RecordType
SerialNumber
genDate
eDate
GridValue Delimiter \",\" Prefix
RowNum
Trailer[/code:1:6b430db73b]-
August 17, 2006 at 6:08 AM #15323
With the Address record you get
A,dd,With the GridData record you get
G,dd,2006-07-10T10:20:37+0100,But because the GridData record has another record as a child it adds that data of 1,1 – the comma here comes from GridData not GridValue, as having an Infix delimiter on a single field record will not do anything.
By adding GridLine you still get GridData of:
G,dd,2006-07-10T10:20:37+0100,plus GridValue now with a prefix delimiter
,1,1for net result of
G,dd,2006-07-10T10:20:37+0100,,1,1If you just set the delimiter to be prefix on GridValue but keeping it as a child of GridData you will get
G,dd,2006-07-10T10:20:37+0100,,1,,1There will be 2 commas between the RowNums, one from GridData and one from GridValue
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.