找不到文件"Card.dtd". [英] Could not find file 'Card.dtd'.

查看:60
本文介绍了找不到文件"Card.dtd".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试读取xml文件,它在xdoc.Load上显示异常.

XmlDocument xdoc =新的XmlDocument();
xdoc.Load(@"J:\ PA Feed \ PAHRFEED \ c20120714yor.xml");

I''m trying to read xml file it shows exception on xdoc.Load.

XmlDocument xdoc = new XmlDocument();
xdoc.Load(@"J:\PA Feed\PAHRFEED\c20120714yor.xml");

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE HorseRacingCard SYSTEM "HorseRacingCard.dtd">
<HorseRacingCard>
  <Meeting status="Dormant" id="49003" country="England" course="York" date="20120714">


    <Race trifecta="No" id="412990" date="20120714" time="1355+0100" raceType="Flat" trackType="Turf" handicap="Yes" class="3" showcase="No">
  </Race>
  </Meeting>
</HorseRacingCard>

推荐答案

有效" XML文档是格式良好"的XML文档,它也符合文档类型定义(DTD)的规则. DTD的目的是定义XML文档的结构.它使用法律元素列表定义结构.

详细信息可以在这里阅读:
http://www.w3schools.com/xml/xml_dtd.asp [ http://en.wikipedia.org/wiki/Document_Type_Definition [
A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD). The purpose of a DTD is to define the structure of an XML document. It defines the structure with a list of legal elements.

Details can be read here:
http://www.w3schools.com/xml/xml_dtd.asp[^]
http://en.wikipedia.org/wiki/Document_Type_Definition[^]

It looks like you have your own DTD defined for the XML''s that you are using. While loading, those DTD''s are expected to be present to validate the XML.
Either provide it or remove the DTD reference (full DOCTYPE tag) from your XML.


这篇关于找不到文件"Card.dtd".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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