XML配置文件的智能感知(IntelliSense)功能
2005-10-09 16:20
399 查看
在使用一些第三方的程序库(Nhibernate,Ibatis...)常常需要手工编写比较复杂的配置文件,如果没有像VS
IDE那样的IntelliSense功能的话,写起来很不方便,效率低下,也容易出错。在看NHibernate帮助文档时看到了这段话,
To get intellisense
while working with the
of VisualStudio.NET you should copy the schema to the folder
。[/code]
在Nhibernate 源码工程下找到nhibernate-mapping-2.0.xsd 文件,把它拷到上面所介绍的目录下,再来编写Nhibernate的映射配置文件。惊喜出现了!很简单,不过要注意:
根结点的xmlns属性的值要跟Schema的targetNamespace属性值一样。如下:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<xs:schema targetNamespace="urn:nhibernate-mapping-2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:nhibernate-mapping-2.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
今天在写IbatisNET配置文件时也去网上找到了sqlMap.XSD,方便多了。
IDE那样的IntelliSense功能的话,写起来很不方便,效率低下,也容易出错。在看NHibernate帮助文档时看到了这段话,
To get intellisense
while working with the
hibernate-mappingxml inside
of VisualStudio.NET you should copy the schema to the folder
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml
。[/code]
在Nhibernate 源码工程下找到nhibernate-mapping-2.0.xsd 文件,把它拷到上面所介绍的目录下,再来编写Nhibernate的映射配置文件。惊喜出现了!很简单,不过要注意:
根结点的xmlns属性的值要跟Schema的targetNamespace属性值一样。如下:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<xs:schema targetNamespace="urn:nhibernate-mapping-2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:nhibernate-mapping-2.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
今天在写IbatisNET配置文件时也去网上找到了sqlMap.XSD,方便多了。
相关文章推荐
- (Nhibernate )XML配置文件的智能感知(IntelliSense)功能
- 如何配置NHibernate的XML配置文件的智能感知(IntelliSense)功能 ?
- 为WSS3.0开发配置对CAML文件的智能感知功能
- 配置文件加入智能提示(Intellisense)功能
- VS web.config/app.conifg配置文件自定义类型使用智能感知功能
- 文档转载,可以参考。SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释
- 安装VS2010 SP1后SQL Server 2008 r2智能感知功能(IntelliSense)失效!
- SQL Server 2008 r2智能感知功能(IntelliSense)失效的一个解决方案
- Nhibernate为hbm.xml配置文件添加智能提示(VS2010)
- android XML File配置资源文件使用详解、属性功能详解之Drawable
- 为 eclipse 的 hibernate 配置文件(*.hbm.xml)加上自动提示功能
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释
- 安装VS2010 SP1后SQL Server 2008 r2智能感知功能(IntelliSense)失效的一个解决方案
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释
- struts2环境配置以及配置xml文件智能提示
- 文档转载,可以参考。SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释
- 安装VS2010 SP1后SQL Server 2008 r2智能感知功能(IntelliSense)失效!
- 安装VS2010 SP1后SQL Server 2008 r2智能感知功能(IntelliSense)失效!
- myeclipse中写struts.xml配置文件打开提示功能