Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Parsing a complex flat file may fail in BizTalk Server 2006 and in BizTalk Server 2004


View products that this article applies to.

Symptoms

When you try to parse a complex flat file in Microsoft BizTalk Server 2006 or in Microsoft BizTalk Server 2004, the parser may fail, and you may receive an error message that is similar to one of the following error messages:

Error message 1
Unexpected Data Found while looking for ElementName
Error message 2
Unable to match the data in the input stream

↑ Back to the top


Cause

This problem may occur when the parser_optimization property is set to the default value of "speed" in the schema. Additionally, if you have many optional nodes in the same group or record, the lookahead_depth property may not be set correctly.

↑ Back to the top


Resolution

To resolve this problem, set the parser_optimization property to "complexity" and the lookahead_depth property to "0" (zero) in the schema. The parser_optimization property and the lookahead_depth property are not present in the user interface. You must manually change the properties in the schemaInfo element, as in the following example:
<b:schemaInfo parser_optimization="complexity" lookahead_depth="0"/> 

↑ Back to the top


More information

BizTalk Server has the following two modes for the algorithm to parse a flat file into XML:
  • "speed"
  • "complexity"
By default, the setting for the parser_optimization property is "speed." This setting is optimized to decrease parsing time. The "speed" setting can handle most flat files but cannot deal with all the ambiguities that the "complexity" setting can. The "complexity" mode is not quick but can handle a wider range of ambiguities.

There are five properties that cannot be changed in the BizTalk Server 2004 user interface. The following table lists the flat file node properties:
Collapse this tableExpand this table
PropertyValuesDefault valueDescription
suppress_empty_nodestrue or falsefalseIndicates whether to remove empty XML nodes after the parser generates XML instance data.
generate_empty_nodestrue or falsetrueGenerates empty nodes for records that exist in the XML instance data.
parser_optimizationspeed or complexityspeedOptimizing for speed decreases the parsing time at the cost of dealing with some ambiguities in data. Optimizing for complexity handles a wider range of ambiguities at the cost of processing speed.
lookahead_depthAny positive integer. A value of 0 (zero) indicates infinite lookahead.3Indicates how far to look ahead for matching data.
allow_early_terminationtrue or falsefalseIndicates whether positional records can terminate early (true) or must contain data for all record fields (false).
Note If you set the allow_early_termination property to true, early termination of a positional record is permitted in cases where the right-most or outermost field is less than its defined length.

↑ Back to the top


Keywords: KB884622, kbprb, kbtshoot, kbbiztalk2004-2006swept

↑ Back to the top

Article Info
Article ID : 884622
Revision : 5
Created on : 6/16/2006
Published on : 6/16/2006
Exists online : False
Views : 535