读取xml文件时出现问题 [英] Problem in reading xml file

查看:134
本文介绍了读取xml文件时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想通过SSIS读取xml文件.但是当我阅读它时,它显示了类似
的错误

Error at Data Flow Task [XML Source [126]]: There was an error setting up the mapping. DTD is prohibited in this XML document.

我有一个.dtd文件,但不知道如何使用它而不是.xsd.你想做什么.如果要使用DTD文件而不是XSD,则根据此消息,您想做一些不被接受的事情.也许您需要学习如何使用XSD而不是DTD,这更容易,因为XSD提供了比文档类型定义更广泛的表达能力.

在此处了解有关文档类型定义的信息: http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-prolog-dtd [外部实体进行定义.

从这里开始学习使用XML Schema:
http://en.wikipedia.org/wiki/XML_Schema_%28W3C%29 [ ^ ],请使用指向本文中显示的W3标准的链接. />
您无法获得更具体的答案,因为您的问题信息非常有限.

—SA



感谢您的回复.我已经阅读了文件,我只是通过VS创建了一个.xsd文件,然后转到了下一步.

现在,我可以看到这些列,并且可以映射它们并使用所有东西,但只能在设计模式下使用.

运行程序包时出现此错误

[XML Source [2944]] Error: The component "XML Source" (2944) was unable to read the XML data. DTD is prohibited in this XML document.

我不能不解决这个错误就走不远了:(

请帮助
谢谢


hi,

I want to read an xml file via SSIS. but when I read it, it shows that error like


Error at Data Flow Task [XML Source [126]]: There was an error setting up the mapping. DTD is prohibited in this XML document.

I''ve a .dtd file but dont know how to use it instead of .xsd.

解决方案

Well, read the error message again: it says the opposite to what you want to do. If you want to use DTD file instead of XSD, you want to do something which is not accepted, according to this message. Perhaps you need to learn how to use XSD instead of DTD, which is easier, because XSD provides wider expressive capabilities then document type definition.

Lean about document type definition here: http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-prolog-dtd[^].

Please pay attention that the DTD file is not a separate document and usually is not parsed separately from XML file. The "real" XML declaration is DOCTYPE, but it can be defined using one or more external entities.

Learn using XML Schema starting from here:
http://en.wikipedia.org/wiki/XML_Schema_%28W3C%29[^], use links to W3 standards shown in this article.

You cannot get more specific answer as your information in your question is very limited.

—SA


Hi
Thanks for your reply. I''ve read the file, I just create an .xsd file via VS and moved to the next step.

Now I can see the columns and I can map them and use every thing but only in design mode.

When I run the package I get this error

[XML Source [2944]] Error: The component "XML Source" (2944) was unable to read the XML data. DTD is prohibited in this XML document.

I cant go further without solving this error :(

plz help
thanks


这篇关于读取xml文件时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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