zoukankan      html  css  js  c++  java
  • XML配置文件的智能感知(IntelliSense)功能

        在使用一些第三方的程序库(Nhibernate,Ibatis...)常常需要手工编写比较复杂的配置文件,如果没有像VS IDE那样的IntelliSense功能的话,写起来很不方便,效率低下,也容易出错。在看NHibernate帮助文档时看到了这段话,

    To get intellisense while working with the hibernate-mapping xml inside of VisualStudio.NET you should copy the schema to the folder C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml

    在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,方便多了。

  • 相关阅读:
    1856: [Scoi2010]字符串(Catalan数)
    11.6NOIP模拟赛
    bzoj1257[CQOI2007]余数之和(除法分块)
    11.5NOIP模拟赛
    bzoj1048(记忆化搜索)
    置顶公告+更新日志
    CF585F Digits of Number Pi
    [SHOI2007]善意的投票
    [HEOI2015]最短不公共子串
    树形背包复杂度+P3177 [HAOI2015]树上染色
  • 原文地址:https://www.cnblogs.com/hjf1223/p/251007.html
Copyright © 2011-2022 走看看