Page 1 of 1

Problem with XML reader

Posted: Fri Jun 11, 2004 7:01 am
by bks_prasad
HI All
by using XML reader i was trying to read the contents of XML file and loading into some flat file but only two rows r loading into the target
Deptno Empno Ename sal Dname
10 200 xyz2 2000 FINANCE
20 400 xyz4 4000 HR

but four rows should be there in the target.
Plz find the below XML source file




<?xml version="1.0"?>
<!-- Generated for DataStage job XMLTEST1 by XMLWriter(7.1.0.8) at 15:07:26 20 JUN 2004 -->

<TEST>
<TEST>
<DEPT DEPTNO="10">
<EMP>
<EMPNO>100</EMPNO>
<ENAME>XYZ</ENAME>
<SAL>1000</SAL>
</EMP>

<EMP>
<EMPNO>200</EMPNO>
<ENAME>XYZ2</ENAME>
<SAL>2000</SAL>
</EMP>
</DEPT>
<DNAME> FINANCE</DNAME>

<DEPT DEPTNO="20">
<EMP>
<EMPNO>300</EMPNO>
<ENAME>XYZ3</ENAME>
<SAL>3000</SAL>
</EMP>

<EMP>
<EMPNO>400</EMPNO>
<ENAME>XYZ4</ENAME>
<SAL>4000</SAL>
</EMP>

</DEPT>
<DNAME> HR</DNAME>
</TEST>
</TEST>


Thanks in advance.......
Prasad

Posted: Fri Jun 11, 2004 7:09 pm
by ray.wurlod
I can only see two DEPTNO tags in your XML. This might explain why there are only two output rows, since DeptNo is a column. Also, should the DNAME tag precede the closing /DEPT tag?