Hello,
I have a following xml file .
T0020.xml
SAFER 04.02 01.00 REPLACE 2009-09-01T00:00:00 CT 274845 US AR 55002 I 100 2007-11-06 2009-08-03
I have to insert xml data into following table
IRP_ACCOUNT
Field Name Field Type
FILE_NAME VARCHAR2(120) IRP_ACCOUNT_NUMBER VARCHAR2(32) IRP_ACCOUNT_TYPE VARCHAR2(1) IRP_CARRIER_ID_NUMBER VARCHAR2(12) IRP_BASE_COUNTRY VARCHAR2(12) IRP_BASE_STATE VARCHAR2(12) IRP_STATUS_CODE VARCHAR2(12) IRP_STATUS_DATE VARCHAR2(10) IRP_UPDATE_DATE VARCHAR2(10)
My code to insert xml Data into Database is ...
OracleXMLSave oracleXMLSave =new OracleXMLSave(conn, tableNamePro);
//set XSL file.
File xslFileName = new File(CviewFileReader.readFileFromClassPathAsURL(xslFolderLocation + "/" + rootNode.trim() + "/" + xslFileNamePro.trim() + ".xsl").getFile().substring(1).replace("%20", " "));
Reader xsltReader=new FileReader(xslFileName);
oracleXMLSave.setXSLT(xsltReader, null);
//set fileNameParameterValueIn XLS file. so this value insert into database table as "FILE_VALUE" field.
oracleXMLSave.setXSLTParam("FILE_NAME", "'" + onlyXMLfileName + "'");
//set row separter value.
oracleXMLSave.setRowTag(xmlRowTagVal);
//set ignoreCase to true.
oracleXMLSave.setIgnoreCase(true);
//give here XML file path
FileInputStream xmlFileNameForInserting = new FileInputStream(xmlFileName.getAbsoluteFile());
oracleXMLSave.insertXML(xmlFileNameForInserting);
My XSLT File for Inserting Data is ...
When applying this xslt to insert to Database only FILE_NAME value which has been passed through xslt parameter is not inserted into Database.
See below all value are inserted except FILE_NAME.
FILE_NAME IRP_ACCOUNT_NUMBER IRP_ACCOUNT_TYPE IRP_CARRIER_ID_NUMBER IRP_BASE_COUNTRY IRP_BASE_STATE IRP_STATUS_CODE IRP_STATUS_DATE IRP_UPDATE_DATE
55002 I 274845 US AR 100 2007-11-06 2009-08-03
I have stuck on this point Pls help me....still any confusion then let me know...
Thanks in Advance.