Invoking the Flat File Parsing Engine

The flat file parsing engine can be invoked by calling the Parse method of the IFFDocumentSpec interface, which in turn is typecast from the IDocumentSpec Interface retrieved from the PipelineContext. Because the XmlReader returned from the Parse method allows clients to retrieve one node at a time, this is a good opportunity to customize the parser.

Example

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  
      //   
   }  
}  

See Also

Using the Flat File Parsing Engine