为什么不工作我ITexthandler?我试图解析XML转换iTextSharp的文档 [英] Why is my ITexthandler not working? I'm trying to parse XML into ITextSharp doc

查看:248
本文介绍了为什么不工作我ITexthandler?我试图解析XML转换iTextSharp的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual开发2010年,MVC 3,C#。我试图解析XML成为一个像这样的文件iTextSharp的:

I’m using Visual Developer 2010, MVC 3, c#. I’m trying to parse XML into an iTextSharp document like this:

        ITextHandler textHandler = new ITextHandler(doc);
        textHandler.Parse(xmldoc);

该错误消息表示ITextHandler是在此上下文中。我怎样才能使这项工作?还是有另一种构造会做同样的事情?

The error message says ITextHandler is not in this context. How can I make this work? Or is there another constructor that will do the same thing?

下面是我使用的语句列表:

Here’s my list of using statements:

using System;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Xml;
using iTextSharp.text;
using iTextSharp.text.xml;
using iTextSharp.text.pdf;

一切似乎正确地编译除了ITextHandler线。请帮助。

Everything else seems to compile properly except for the ITextHandler line. Please help.

推荐答案

ITextHandler 是的iText和iTextSharp的4.x版系列的一部分,但是从5.x系列已经被删除赞成 iTextSharp.text.xml.simpleparser.SimpleXMLParser 的。近几个月来,但是,另一个项目已获得青睐XML和HTML解析。大多数情况下,如果不是所有的XML和HTML工作前进被在独立的库进行 xmlworker 此处找到。随着该库,你会发现 iTextSharp.tool.xml.parser.XMLParser 类。

ITextHandler is part of iText and iTextSharp 4.x series but was removed from the 5.x series in favor of iTextSharp.text.xml.simpleparser.SimpleXMLParser. In recent months, however, another project has been gaining favor for XML and HTML parsing. Most, if not all XML and HTML work going forward is being done in the separate library xmlworker found here. With in that library you'll find the iTextSharp.tool.xml.parser.XMLParser class.

这篇关于为什么不工作我ITexthandler?我试图解析XML转换iTextSharp的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆