共用方式為


呼叫平面文件剖析引擎

可藉由從 PipelineContext 擷取的 IDocumentSpec Interface 進行型別轉換,然後呼叫 IFFDocumentSpec 介面的 Parse 方法來叫用一般檔案剖析引擎。 由於從 Parse 方法傳回的 XmlReader 可讓用戶端一次擷取一個節點,因此這是自定義剖析器的好機會。

範例

XmlReader xr = docspec.Parse(new DataReader());  
while (xr.Read())  
{  
   switch(xr.NodeType)  
   {  
      case XmlNodeType.Element :  
         // Customize the element  
         //   
         break;  
      case XmlNodeType.Attribute :  
         // Customize the attribute  
         //   
         break;  
      // Customize other types of nodes  
      //   
   }  
}  

另請參閱

使用平面檔案剖析引擎