Hi Folks,
I have an xml response, which I want to store into the database (mysql) through XSLT script.
For basic data types, I can just prepare a simple insert statement through xslt script which further passed to java for further execution.
<xsl:template match="ota:OTA_TT_HotelResRS">insert into booking
(createdBy, bookingNumber, created, modified, start, end, bookingType, hotelName, duration, numberOfPassengers, surname, status, touroperator, agency_code, departure3LC, arrival3LC, travelCode, totalPrice)
values (
"<xsl:value-of select="$profileNode/ota:OTA_TT_ProfileReadRS/ota:Profiles/ota:ProfileInfo/ota:UniqueID/@ID"/>",
"<xsl:value-of select="ota:HotelReservations/ota:HotelReservation/ota:ResGlobalInfo/ota:HotelReservationIDs/ota:HotelReservationID/@ResID_Value"/>",
NULL,
NULL,
..
..
)
</xsl:template>
But now I have got an additional column where I want to store the entire xml response as blob object as well. That in addition to the few columns (shown above), I want to store the same entire response as in the last column 'bookXMLDoc' of this book table.
<xsl:template match="ota:OTA_TT_HotelResRS">insert into booking
(createdBy, bookingNumber, created, modified, start, end, bookingType, hotelName, duration, numberOfPassengers, surname, status, touroperator, agency_code, departure3LC, arrival3LC, travelCode, totalPrice, bookXmlDoc)
values (
So I have no idea how to do this? One approach could be to use java prepared statement inside the xslt script and finally executing it inside the xslt that is opening, creation, execution of database connection everything inside the xslt script.
Also please tell how to access the java object from xml response and store it as blob through the xslt script?
I hope i have explained the problem correctly.
Basic example would be very good.
Awaiting replies.