在Nhibernate中使用Doctype [英] Using Doctype in Nhibernate

查看:107
本文介绍了在Nhibernate中使用Doctype的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将基类的公共属性放在一个位置,并使用XML ENTITY在Nhibernate映射文件中进行引用.

Hi I am trying to keep common properties of base class in one location and use XML ENTITY to refer in Nhibernate mapping file.

映射文件

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE hibernate-mapping [
  <!ENTITY BasePropertyList SYSTEM "BasePropertyList.xml">
]>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Model" namespace= "Model" default-lazy="false">
<class name="DerivedClass">
    &BasePropertyList;
</class>
</hibernate-mapping>

BasePropertyList.xml

BasePropertyList.xml

<id name="ID" column="ID" type="Int32" unsaved-value="0">
 <generator class="native"></generator>
</id>
<property name="CreatedDate" update="false" />
<property name="CreatedBy" update="false" />
<property name="LastModifiedDate" />
<property name="LastModifiedBy" />

我正在追随异常

System.Xml.XmlException:此XML文档中禁止使用DTD. 在NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)

System.Xml.XmlException : DTD is prohibited in this XML document. at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)

我在这里错过了什么吗? DOCTYPE如何在Nhibernate映射文件中工作?

Am I missing anything here? How DOCTYPE works in Nhibernate mapping file??

推荐答案

在当前版本中已损坏. 我遇到了同样的问题,我已经测试了2.0.1、2.1.0、2.1.1、2.1.2版本,但它已损坏

It is broken in the current release. I had the same problem and i have tested versions 2.0.1, 2.1.0, 2.1.1, 2.1.2 and it was broken

如果我正确阅读了,它就不会被修复,并且看起来是参考文档中的遗留物

If i read this correctly, its not going to be fixed and it seems that it is a left over in the reference documentation

这篇关于在Nhibernate中使用Doctype的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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