ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Grabowski (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATISNET-77) Allow Intellisense in Visual Studio 2003 for SqlMap/Dao.config/SqlMap.config files
Date Sat, 09 Jul 2005 17:57:12 GMT
    [ http://issues.apache.org/jira/browse/IBATISNET-77?page=comments#action_12315406 ] 

Ron Grabowski commented on IBATISNET-77:
----------------------------------------

When I copy this file:

 http://svn.apache.org/repos/asf/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapConfig.xsd

To this folder (the default installation folder of Visual Studio 2003)

 C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml\

And use this snippet from my sqlMap.config file:

 <sqlMapConfig xmlns="http://ibatis.apache.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibatis.apache.org
http://ibatis.apache.org/xsd/SqlMapConfig.xsd">
 <properties>
  <property key="SELECT_KEY" value="SELECT @@IDENTITY" />
  <property key="NOW" value="NOW()" />
 </properties>
 ...

Visual Studio complains:

 The active schema does not support the element  'sqlMapConfig'.
 The active schema does not support the element  'property'.
 The active schema does not support the element  'settings'.
 The active schema does not support the element  'setting'.
 The active schema does not support the element  'providers'.
 The active schema does not support the element  'sqlMap'.
 The active schema does not support the element  'sqlMaps'.

Intellisense _does_ work for the properties, database, provider, and dataSource nodes.

I get the same errors when I use this layout:

 <sqlMapConfig
  xmlns="http://ibatis.apache.org" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://ibatis.apache.org http://ibatis.apache.org/xsd/SqlMapConfig.xsd">
 <properties>
  <property key="SELECT_KEY" value="SELECT @@IDENTITY" />
  <property key="NOW" value="NOW()" />
 </properties>
 ...

I also checked that the order of the elements in my sqlMap.config file matches the order defined
in the SqlMapConfig.xsd file:

 <xs:element name="sqlMapConfig">
  <xs:complexType mixed="true">
   <xs:sequence>
    <xs:element ref="properties" minOccurs="0"/>
    <xs:element ref="settings" minOccurs="0"/>
    <xs:element ref="providers" minOccurs="0"/>
    <xs:element ref="database" minOccurs="0"/>
    <xs:element ref="alias" minOccurs="0"/>
    <xs:element ref="typeHandlers" minOccurs="0"/>
    <xs:element ref="sqlMaps" minOccurs="0"/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>

> Allow Intellisense in Visual Studio 2003 for SqlMap/Dao.config/SqlMap.config files
> ----------------------------------------------------------------------------------
>
>          Key: IBATISNET-77
>          URL: http://issues.apache.org/jira/browse/IBATISNET-77
>      Project: iBatis for .NET
>         Type: Improvement
>  Environment: Windows Platform, Visual Studio.NET 2003
>     Reporter: Chad Humphries
>     Assignee: Gilles Bayon
>     Priority: Trivial
>      Fix For: DataMapper 1.3

>
> The following instructions will enable Intellisense in your SqlMaps, SqlMap.config, and
Dao.config files.  Based off of the Nant Visual Studio Intellisense integration how-to at
[http://nant.sourceforge.net/faq.html#enable-intellisense].
> Step 1:
> Make sure you have Visual Studio.net 2003 closed.  Locate the xsd files.  Typically they
are in the following locations if you have downloaded the source.
> SqlMapConfig.xsd, SqlMap.xsd
> [SourceFolder]\mapper\IBatisNet.DataMapper
> DaoConfig.xsd
> [SourceFolder]\mapper\IBatisNet.Schemas
> Step 2:
> Copy the xsd files to your Visual Studio 2003 Schema Folder.  This is typically located
at C:\program files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml.
> Step 3:
> Open the XSD files to make the changes below to them.
> Step 4:
> Open your dao.config, sqlmaps, or sqlmap.config and make the changes below.
> Step 5:
> Open Visual Studio 2003.  Make sure you have set Visual Studio to open your SqlMap.config,
Dao.Config, and Sqlmaps with HTML/XML Editor.  You can find this by right-clicking on the
file in Solution Explorer and choosing Open With.  You may wish to make this the default method
to avoid having to use Open With every time.
> Step 6:
> Enjoy!
> ========================
> SqlMapConfig Start
> ========================
> [SqlMapConfig.xsd]
> Before:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
> After:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="SqlMapConfig.xsd" >
> [SqlMap.config]
> Before:
> <sqlMapConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd">
> After:
> <sqlMapConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd"
xmlns="SqlMapConfig.xsd">
> ========================
> SqlMapConfig Finish
> ========================
> ========================
> SqlMap Start
> ========================
> [SqlMap.xsd]
> Before:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
>
> After:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="SqlMap.xsd" >
> [YourSqlMap.xml]
> Before:
> <sqlMap namespace="example" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMap.xsd">
> After:
> <sqlMap namespace="example" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMap.xsd" xmlns="SqlMap.xsd">
> ========================
> SqlMap Finish
> ========================
> ========================
> Dao Start
> ========================
> [DaoConfig.xsd]
> Before:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
>
> After:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="DaoConfig.xsd" >
> [Dao.config]
> Before:
> <daoConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="DaoConfig.xsd">
> After:
> <daoConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="DaoConfig.xsd"
xmlns="DaoConfig.xsd">
> ========================
> Dao Finish
> ========================

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message