ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: org.xml.sax.SAXParseException: Attribute "id" is required and must be specified for element type "delete".
Date Wed, 19 Oct 2005 14:28:59 GMT
You should use a closing delete-tag instead of a new one :)

<delete id="removeMap">
  delete from maps where id = #id#
<delete>

Perhaps you should consider to edit your SQLMaps in an DTD-aware
application...

Grtz,

Niels

-----Original Message-----
From: David Moss [mailto:davidm@graticule.com] 
Sent: woensdag 19 oktober 2005 16:26
To: user-java@ibatis.apache.org
Subject: org.xml.sax.SAXParseException: Attribute "id" is required and
must be specified for element type "delete".

I'm getting this exception when trying to start my web app in Tomcat5.

my sql-map-config.xml file contains:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config
    2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
    <sqlMapConfig>
        <sqlMap resource="com/graticule/ecorisk/db/ibatis/maps/User.xml"
/>
        <sqlMap resource="com/graticule/ecorisk/db/ibatis/maps/Map.xml"
/>
        <!--<sqlMap
    resource="com/graticule/ecorisk/db/ibatis/maps/Layer.xml" />-->
    </sqlMapConfig>



and Map.xml contains...



    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
    "http://www.ibatis.com/dtd/sql-map-2.dtd">

    <sqlMap namespace="Map">

        <resultMap id="result" class="com.graticule.ecorisk.bus.Map">
            <result property="id" column="id" columnIndex="1" />
            <result property="name" column="name" columnIndex="2" />
            <result property="description" column="description"
    columnIndex="3" />
            <result property="owner" column="owner" columnIndex="4" />
        </resultMap>
       
        <delete id="removeMap">
            delete from maps where id = #id#
        <delete>
       
        <insert id="addMap">
            insert into maps (name, description, owner) values (#name#,
    #description#, #owner#)
        </insert>
       
        <select id="getMapById" resultMap="result">
            select * from maps where id = #id#
        </select>
       
        <select id="getMapList" resultMap="result">
            select * from users
        </select>
       
        <update id="updateMap">
            update maps set
                name = #name#
                description = #description#
                owner = #owner#
              where id = #id#
        </update>
       
    </sqlMap>

If I comment out the Map sql resource file then the problems dissappear,

so I guess that there's something wrong with Map.xml but I can't see 
what it is.  Could anyone help me?

David Moss.

-- 
**********************************************************************
* The information in this message is confidential and is for         *
* the addressee(s) only.  If you have received this message in error,*
* please notify the sender. Unauthorised use,disclosure,duplication  *
* or alteration of this message are forbidden. This message and any  *
* attachments have been scanned for viruses. Graticule will not be   *
* liable for direct, indirect or consequential damages arising from  *
* altering the contents of this message by a third party or as a     *
* result of any virus being passed on.                               *
* ------------------------------------------------------------------ *
* Unless stated otherwise - prices quoted in this e-mail are in      *
*  British Pounds Sterling and exclude media charges, package and    *
*  postage and Value Added Tax (VAT), where applicable. Prices are   *
*  valid for a period of 30 days from the date of this e-mail. Annual*
*  renewal fees are subject to change without notice. Transactions   *
*  are subject to our Terms of Business:                             *
*  (http://www.graticule.com/company/terms.pdf).                     *
********************************************************************** 


Mime
View raw message