【问题标题】:Can you define entities in external dtd file, linked to xml file?您可以在链接到 xml 文件的外部 dtd 文件中定义实体吗?
【发布时间】:2021-12-07 14:48:01
【问题描述】:

我的 xml:

<Car no="10" CarID="id_111-110">
      <ProductionD>07.12.2010</ProductionD>
      <MarketValue currency="$">12499.99</MarketValue>
      <VisitedCountries>
        <Country no="1">
        &MCountry;
        </Country>
        <Country no="2">
        Andora
        </Country>
      </VisitedCountries>
    </Car>

实体,放在另一个文件中:

<!ENTITY MCountry "Poland">

这样,它不起作用,Country 中只有一个空白字段,而如果我直接在 xml 文件中声明实体,它就可以正常工作。

【问题讨论】:

    标签: xml dtd


    【解决方案1】:

    这取决于您的网络浏览器,但其中大多数不完全支持 XML。它们有限制,比如没有外部 DTD 实体。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-08
      • 2015-09-29
      • 2017-09-01
      • 1970-01-01
      • 2011-01-07
      • 1970-01-01
      • 2010-10-12
      相关资源
      最近更新 更多