善待自己,珍惜今天,恩泽他人,享受生活

不放弃任何解决困难的机会,人的一生就是解决困难的过程。 当我们走完一生才能说没有问题要解决了。 面对工作、生活上的压力,面对来自家庭、朋友、同事、上司等的困惑。 要排除万难,否则我们就会被万难排除!

博客园 首页 新随笔 联系 订阅 管理

当我们在Microsoft Visual Studio 2005里编写DBC的XML文件时,如果能够智能感知schema该多好啊, 我原来看到别人实现了,还以为是利用代码段实现呢,最近查看SDK,发现只需要按以下步骤操作即可:
1.将BdcMetadata.XSD文件拷贝到xml文件同目录位置或指定BdcMetadata.XSD位置
2.修改schemaLocation,注意下面红色字部分,如果将BdcMetadata.XSD文件拷贝到xml文件同目录位置,则不需做任何修改,如果不是,则需要修改为BdcMetadata.XSD存在的位置.

注意: XSD文件存在于<Root>\Program Files\Microsoft Office Server\12.0\Bin
他能很大程度上简化DBC文件的编写.

<LobSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Type="Database" Version="1.0.0.1" Name="AdventureWorksDW_ding" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

下面是SDK 里的原话:

The Business Data Catalog provides a schema definition file (XSD) that defines the schema that is allowed in the XML file, which in turn defines the metadata for a business application. The XML documents must adhere to this schema.

You can find the BdcMetadata.XSD file in the \Bin directory of your Office SharePoint Server 2007 installation, typically at <Root>\Program Files\Microsoft Office Server\12.0\Bin.

When you author metadata in Microsoft Visual Studio 2005, copy the XSD to your working folder and set the SchemaLocation attribute in the XML file to point to the schema file. Visual Studio 2005 provides IntelliSense capabilities that greatly simplify editing.


 

posted on 2007-06-04 16:08  笨笨丁  阅读(545)  评论(1编辑  收藏  举报