共用方式為


剖析模式

剖析模式是schemaInfo記錄上的屬性,具有兩種模式:速度和複雜度。 您可以在 BizTalk 架構編輯器中設定剖析器優化屬性。

範例

<b:schemaInfo count_positions_by_byte="false" standard="Flat File"   
root_reference="document" parser_optimization="complexity" />.  

在速度模式中,解析器會嘗試在數據流出現時即時調整以適應新的數據。 例如,假設有下列架構。

<schema>  
   Root ("," prefix)  
      Field1   opt  
      Field2   opt  
      Field3   opt  
      Field4   opt  
      Record ("," infix)  
            Field5  
            Field6  
</schema>  

和輸入訊息。

,1,2,3,4  

使用速度模式取得下列 XML 檔。

<Root>  
   <Field1>1</Field1>  
   <Field2>2</Field2>  
   <Field3>3</Field3>  
   <Field4>4</Field4>  
</Root>  

使用複雜度模式時,相同的架構會產生下列輸出。

<Root>  
   <Field1>1</Field1>  
   <Field2>2</Field2>  
      <Record>  
         <Field5>3</Field5>  
         <Field6>4</Field6>  
      </Record>  
</Root>  

在複雜度模式中,平面文件剖析引擎會同時使用自上而下和自底向上的剖析,並嘗試更精確地調整數據。 在高速模式下,解析器會嘗試適應數據流中出現的資料。

如果您有具有必要元素的選擇性元素,例如。

<schema>  
   Root  
      Record1 (required)  
  
      Record2 (optional)  
  
      Record3 (required)  
  

您必須使用複雜度模式來正確剖析資料,因為剖析器在內部表示架構為 。

<schema>  
   Root  
      Record1 (required)  
      <sequence> (optional)  
         Record2 (required)  
         Record3 (required)  

另請參閱

使用平面檔案剖析引擎