i have written a sql loader script given below....
load data
infile 'contact1.xml' "str '</CONTACT>'"
truncate
into table XmlTest
(
dummy filler terminated by ">",
Location_id enclosed by "<Location_ id>" and "</Location_id>",
fname enclosed by "<fname>" and "</fname>",
lname enclosed by "<lname>" and "</lname>"
)
the content of the contact1.xml is given below.....
<CONTACT>
<Location_id> 1</Location_id>
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
<CONTACT>
<Location_id> 1</Location_id>
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
the script works fine for the given xml... but if one of the tag in the xml is changed to below syntax....
<CONTACT Location_id="1" >
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
<CONTACT Location_id="1" >
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
the script fails....
what modification is required in the script to read such xml...Kindly Help!!
load data
infile 'contact1.xml' "str '</CONTACT>'"
truncate
into table XmlTest
(
dummy filler terminated by ">",
Location_id enclosed by "<Location_ id>" and "</Location_id>",
fname enclosed by "<fname>" and "</fname>",
lname enclosed by "<lname>" and "</lname>"
)
the content of the contact1.xml is given below.....
<CONTACT>
<Location_id> 1</Location_id>
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
<CONTACT>
<Location_id> 1</Location_id>
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
the script works fine for the given xml... but if one of the tag in the xml is changed to below syntax....
<CONTACT Location_id="1" >
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
<CONTACT Location_id="1" >
<fname>Robert </fname>
<lname>Jones</lname>
</CONTACT>
the script fails....
what modification is required in the script to read such xml...Kindly Help!!