9: l_formatted_doc CLOB;
10: lv_stylesheet varchar2(32767);
11: l_stylesheet_url varchar2(2000);
12: stylesheetdoc xmldom.DOMDocument;
13: stylesheet xslprocessor.Stylesheet;
14: engine xslprocessor.Processor;
15: parser xmlparser.parser;
16: xmldoc xmldom.DOMDocument;
17: clobdoc CLOB;
10: lv_stylesheet varchar2(32767);
11: l_stylesheet_url varchar2(2000);
12: stylesheetdoc xmldom.DOMDocument;
13: stylesheet xslprocessor.Stylesheet;
14: engine xslprocessor.Processor;
15: parser xmlparser.parser;
16: xmldoc xmldom.DOMDocument;
17: clobdoc CLOB;
18: ctx DBMS_XMLQUERY.ctxType;
379: hr_utility.set_location('Exiting after setting encoding',233);
380:
381: xmlparser.parseCLOB(parser,clobdoc);
382: xmldoc:=xmlparser.getDocument(parser);
383: engine:=xslprocessor.newProcessor;
384: xmlparser.parseBuffer(parser,lv_stylesheet);
385: stylesheetdoc:=xmlparser.getDocument(parser);
386: stylesheet:=xslprocessor.newStylesheet(stylesheetdoc,null);
387: hr_utility.set_location('Parsing the stylesheet',24);
382: xmldoc:=xmlparser.getDocument(parser);
383: engine:=xslprocessor.newProcessor;
384: xmlparser.parseBuffer(parser,lv_stylesheet);
385: stylesheetdoc:=xmlparser.getDocument(parser);
386: stylesheet:=xslprocessor.newStylesheet(stylesheetdoc,null);
387: hr_utility.set_location('Parsing the stylesheet',24);
388: xslprocessor.processXSL(engine,stylesheet,xmldoc,l_formatted_doc);
389: hr_utility.set_location('Parsing Sucess. Freeing parser',25);
390: xslprocessor.freeStylesheet(stylesheet);
384: xmlparser.parseBuffer(parser,lv_stylesheet);
385: stylesheetdoc:=xmlparser.getDocument(parser);
386: stylesheet:=xslprocessor.newStylesheet(stylesheetdoc,null);
387: hr_utility.set_location('Parsing the stylesheet',24);
388: xslprocessor.processXSL(engine,stylesheet,xmldoc,l_formatted_doc);
389: hr_utility.set_location('Parsing Sucess. Freeing parser',25);
390: xslprocessor.freeStylesheet(stylesheet);
391: xmldom.freeDocument(stylesheetdoc);
392: xmlParser.freeParser(parser);
386: stylesheet:=xslprocessor.newStylesheet(stylesheetdoc,null);
387: hr_utility.set_location('Parsing the stylesheet',24);
388: xslprocessor.processXSL(engine,stylesheet,xmldoc,l_formatted_doc);
389: hr_utility.set_location('Parsing Sucess. Freeing parser',25);
390: xslprocessor.freeStylesheet(stylesheet);
391: xmldom.freeDocument(stylesheetdoc);
392: xmlParser.freeParser(parser);
393: xslprocessor.freeProcessor(engine);
394: xmldom.freeDocument(xmldoc);
389: hr_utility.set_location('Parsing Sucess. Freeing parser',25);
390: xslprocessor.freeStylesheet(stylesheet);
391: xmldom.freeDocument(stylesheetdoc);
392: xmlParser.freeParser(parser);
393: xslprocessor.freeProcessor(engine);
394: xmldom.freeDocument(xmldoc);
395: p_raw_doc:=clobdoc;
396:
397: if(p_stylesheet is null and substr(l_formatted_doc,0,5)<> '
406: hr_utility.set_location('Exception occured',27);
407: hr_utility.set_location('Exception: '||substrb(sqlerrm,1,160),28);
408: hr_utility.set_location('Exception: '||sqlcode,29);
409: xmlParser.freeParser(parser);
410: xslprocessor.freeProcessor(engine);
411: xslprocessor.freeStylesheet(stylesheet);
412: xmldom.freeDocument(xmldoc);
413: xmldom.freeDocument(stylesheetdoc);
414: raise;
407: hr_utility.set_location('Exception: '||substrb(sqlerrm,1,160),28);
408: hr_utility.set_location('Exception: '||sqlcode,29);
409: xmlParser.freeParser(parser);
410: xslprocessor.freeProcessor(engine);
411: xslprocessor.freeStylesheet(stylesheet);
412: xmldom.freeDocument(xmldoc);
413: xmldom.freeDocument(stylesheetdoc);
414: raise;
415: end generateJPSint;