Facing problem while loading XML file into my oracle database table. [message #153612] |
Tue, 03 January 2006 05:52 |
RMAMYY
Messages: 7 Registered: December 2005 Location: BANGALORE
|
Junior Member |
|
|
Hello Experts,
In my XML file two data record blocks are there.In that one block is correct other one is wrong.
Iam using oracle procedures to load this data into my oracle table.While loading its raising 'Invalid XML file' and its coming out.
My question is why its not loading correct data block?
can anybody help me to solve this.....
My one more question is how to handle errors while loading XML file into table? I want to store correct error message into my log file.
This is the XML structure:-
<File xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<FileType>PRISMA</FileType>
<FileName>PRISMA.xml</FileName>
<CreationDate>2005-11-30</CreationDate>
<CreationTime>11:20:30</CreationTime>
</Header>
<Data>
<PRISMA>
<NSP>1</NSP>
<NPTF>MBA1000</NPTF>
<DREPORT>2005-11-30</DREPORT>
<REPORT_NAME>5211</REPORT_NAME>
<NRUBR_ITL> 50536</NRUBR_ITL>
<NSUFF_ITL>02</NSUFF_ITL>
<COPER_ITL> 25</COPER_ITL>
<COPER_ITL_VALUE>1</COPER_ITL_VALUE>
<VALUE>300000000</VALUE>
<VALUE_SIGN>-</VALUE_SIGN>
<LINK_NUMBER>55</LINK_NUMBER>
</PRISMA>
<PRISMA>
<NSP>1</NSP>
<NPTF>MBA100</NPTF>
<DREPORT>2005-11-30</DREPORT>
<REPORT_NAME>5211</REPORT_NAME>
<NRUBR_ITL> 50536</NRUBR_ITL>
<NSUFF_ITL>02</NSUFF_ITL>
<COPER_ITL> 25</COPER_ITL>
<COPER_ITL_VALUE>1</COPER_ITL_VALUE>
<VALUE>300000000</VALUE>
<VALUE_SIGN>-</VALUE_SIGN>
<LINK_NUMBER>55</LINK_NUMBER>
</PRISMA>
</Data>
</File>
In First data record block <NPTF> is exceeds its size what i defined in my XSD and second record block is correct.
In My XSD file I defined <NPTF> as string with size 6.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
.
.
<xs:complexType name="PRISMA_Type">
<xs:all>
.
.
<xs:element name="NPTF" type="Nptf_Type"
nillable="false"/>
.
.
</xs:all>
</xs:complexType>
<xs:simpleType name="Nptf_Type">
<xs:restriction base="xs:string">
<xs:maxLength value="6"/>
</xs:restriction>
</xs:simpleType>
.
.
</xs:schema>
Please help me how to do it.
Thanks&Regards
Mallikarjun
|
|
|