You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by Datta <da...@gmail.com> on 2006/09/05 08:48:56 UTC

Caused by: org.xml.sax.SAXParseException: Element "sqlMap" does not allow text.

Hi all,
I am using dynamic mapped statememts in my application but am gettinh these 
errors:
com.ibatis.common.exception.NestedRuntimeException: Error occurred.  Cause: 
com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: 
com.ibatis.common.exception.NestedRuntimeException: Error parsing 
XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: 
Error parsing XML.  Cause: org.xml.sax.SAXParseException: Element "sqlMap" does 
not allow text.
Caused by: org.xml.sax.SAXParseException: Element "sqlMap" does not allow text.
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: 
org.xml.sax.SAXParseException: Element "sqlMap" does not allow text.
Caused by: org.xml.sax.SAXParseException: Element "sqlMap" does not allow text.
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing 
XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: 
Error parsing XML.  Cause: org.xml.sax.SAXParseException: Element "sqlMap" does 
not allow text.................like this so many errors all saying:

Element "sqlMap" does not allow text.
my employee.xml is:
<resultMap id="get-emp-result" class="src.Employee">
		<result property="empNo" column="empno"/>
		<result property="empName" column="empname"/>
		<result property="deptNo" column="deptno"/>
		<result property="dName" column="dname"/>
</resultMap>
<select id="getEmployee" resultMap="get-emp-result">
	SELECT * FROM myibatisemp
	<dynamic prepend="WHERE">
		<isNotEmpty property="empNo">
		  empno = #empNo#
		</isNotEmpty>
	</dynamic>
</select> and corresponding java code is:
String empNo = "4";
Employee emp =
	(Employee)sqlMap.executeQueryForObject(
	"getEmployee",empNo); 
	System.out.println("Employee No = " + emp.getEmpNo());
        System.out.println("Dept Name = " + emp.getDName());
        System.out.println("Dept No = " + emp.getDeptNo());
        System.out.println("EmpName = " + emp.getEmpName());
plz tell some good tutorials/referrences/books that contains very good examples