可以通过调用 IFFDocumentSpec 接口的 Parse 方法来调用平面文件解析引擎,而该接口又是通过从 PipelineContext 中检索到的IDocumentSpec Interface
进行类型转换而得到的。 由于从 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
//
}
}