130: if (l_doc_xml.extract(l_xpath_temp) IS NOT NULL) then ##ARTICLEWML##
131: l_art_XML := l_doc_xml.extract(l_xpath_temp);
132: l_xpath_temp := l_xpath_clause_elem||'/ArticleText[1]';
133: l_art_xml := xmltype('
134: select updateXML(l_doc_xml,l_xpath_temp,l_art_xml) into l_doc_xml FROM dual;
135: /*ELSE
136: l_xpath_temp := l_xpath_clause_elem||'/ArticleText[1]';
137: select updateXML(l_doc_xml,l_xpath_temp,'
138: */
##ARTICLEWML##
133: l_art_xml := xmltype(' ##ARTICLEWML##
134: select updateXML(l_doc_xml,l_xpath_temp,l_art_xml) into l_doc_xml FROM dual;
135: /*ELSE
136: l_xpath_temp := l_xpath_clause_elem||'/ArticleText[1]';
137: select updateXML(l_doc_xml,l_xpath_temp,'
138: */
139: end if;
140: l_i := l_i+1;
141: l_xpath_clause_elem := '//SectionsArticlesToPrintVORow['||to_char(l_i)||']';
147: ,'//ArticleText[not(.//var)]',' ##ARTICLEWML##
148: ).getClobVal()
149:
150: INTO l_doc_clob
151: FROM dual;
152:
153: l_doc_clob := regexp_replace(l_doc_clob,'~','&');
154:
155: l_progress := 030;
274: --Get Article sub elements
275: l_var_XML := Xmltype('
276:
277: l_progress := '040';
278: --Get the clause text from individual clauses Word doc.
279: select VER.INSERT_BY_REFERENCE,VER.REFERENCE_TEXT,VER.article_text_in_word
280: into l_insert_by_reference,l_reference_text,l_article_text_in_word
281: from okc_article_versions VER,okc_k_articles_b ART
282: where ART.id = l_article_id
316:
317:
318: if (xmltype(l_clob_temp).existsnode('//wlists') > 0) then
319:
320: select deleteXML(XMLType(l_clob_temp),'//wlistDef//wlsid').getClobVal() into l_clob_temp from dual;
321: l_doc_listdef_clob := l_doc_listdef_clob || xmltype(l_clob_temp).extract('//wlistDef').getClobVal();
322: l_doc_list_clob := l_doc_list_clob || xmltype(l_clob_temp).extract('//wlist').getClobVal();
323:
324: end if;
331: SELECT deleteXML( l_doc_xml
332: ,'//ClauseTag/*'
333: )
334: INTO l_doc_xml
335: FROM dual;
336:
337:
338: l_progress := '070';
339: -- Clause Processing --serukull changes
429: select updateXML(xmltype(l_doc_clob),
430: '//SectionTag/@*','',
431: '//ClauseTag/@*','',
432: '//var/@*',''
433: ).getClobVal() into l_doc_clob from dual;
434: l_doc_clob := regexp_replace(l_doc_clob,'<(/)*((SectionsArticlesToPrintVORow)|(TocTag)|(PageHeading)|(SignatureTag)|(LabelTitleTag)|(ArticleText)|(var)|(ClauseTag)|((SectionTag)))[^>.]*>','');
435:
436: -- code to remove custom tags - end
437:
499:
500:
501: v_clob := regexp_replace(regexp_replace(regexp_replace(v_clob,'w:body','wbody'),'w:list','wlist'),'w:lvlPicBulletId','wlvlPicBulletId');
502: v_clob := '
503: select deleteXML(XMLType(v_clob),'//wlvlPicBulletId').getClobVal() into v_clob from dual;
504:
505: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
506: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT ,
507: G_MODULE||l_api_name,
596: -- Get the place holder xml which is used for adding clause text
597: l_progress := '050';
598: INSERT INTO okc_word_sync_t (id,doc_id,doc_type,CLOB_data)
599: select 10,p_doc_id,p_doc_type, deleteXML(l_doc_xml,'//wbody/*').getclobVal()
600: from dual;
601:
602:
603: l_doc_xml_temp := XmlType('
604:
671: l_progress := '120';
672: l_dummy_article_text := XMLType('
673: SELECT UpdateXML(l_doc_xml,
674: '//ArticleText', l_dummy_article_text
675: )INTO l_doc_xml FROM dual;
676: l_doc_clob:= regexp_replace(regexp_replace(l_doc_xml.getClobVal(),'agsfddfsga','w:'),'wbody','w:body');
677:
678: -- Insert the document into okc_word_sync_t
679: l_progress := '130';
762: l_xpath := '//ClauseTag['||to_char(l_i)||']';
763: l_xpath1 := '//ClauseTag['||to_char(l_i)||']/ArticleText[1]/*';
764: l_xpath2 := '//ClauseTag['||to_char(l_i)||']/@CatId';
765:
766: select deleteXML(xmltype(l_doc_clob),'//wbody/*').getClobVal() into l_clob_temp from dual;
767:
768: while ((xmltype(l_doc_clob).existsnode(l_xpath) > 0)) LOOP
769:
770: IF (xmltype(l_doc_clob).extract(l_xpath2).getNumberVal() = p_cat_id) THEN
782:
783: --Replace Variable Tags..
784: --while ((xmltype(l_art_CLOB).existsnode('//var[1]') > 0)) LOOP
785: --l_clob_temp :='
786: --select updateXML(xmltype(l_art_CLOB),'//var[1]',xmltype(l_clob_temp).extract('/DUMMY/*')).getClobVal() into l_art_CLOB from dual;
787: -- select updateXML(xmltype(l_art_CLOB),'//var','
788: --l_art_clob := regexp_replace(l_art_clob,'w#','w:');
789: --END LOOP;
790: --l_art_CLOB := regexp_replace(regexp_replace(l_art_CLOB,'','@]');
783: --Replace Variable Tags..
784: --while ((xmltype(l_art_CLOB).existsnode('//var[1]') > 0)) LOOP
785: --l_clob_temp :='
786: --select updateXML(xmltype(l_art_CLOB),'//var[1]',xmltype(l_clob_temp).extract('/DUMMY/*')).getClobVal() into l_art_CLOB from dual;
787: -- select updateXML(xmltype(l_art_CLOB),'//var','
788: --l_art_clob := regexp_replace(l_art_clob,'w#','w:');
789: --END LOOP;
790: --l_art_CLOB := regexp_replace(regexp_replace(l_art_CLOB,'','@]');
791:
914: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT ,
915: G_MODULE||'GET_WORD_SYNC_PROFILE',
916: '100: Entered '||G_PKG_NAME ||'.'||'GET_WORD_SYNC_PROFILE');
917: END IF;
918: SELECT FND_PROFILE.VALUE('OKC_WORD_SYNC_ART_EDIT') INTO PROF_VALUE FROM DUAL;
919: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
920: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT ,
921: G_MODULE||'GET_WORD_SYNC_PROFILE',
922: '100: Leaving '||G_PKG_NAME ||'.'||'GET_WORD_SYNC_PROFILE');
1024: l_var_str := '
1025: ELSE
1026: l_var_str := '
1027: END IF;
1028: SELECT updateXML( l_art_XML,l_xpath,xmltype(l_var_str).extract('/DUMMY/*')) INTO l_art_XML FROM dual;
1029: l_i := l_i +1;
1030: l_xpath := '//var['||to_char(l_i)||']';
1031: end loop;
1032: l_art_clob:= regexp_replace(l_art_XML.getClobVal(),'agsfddfsga','w:');
1076: l_art_clob CLOB;
1077:
1078:
1079: BEGIN
1080: SELECT deleteXML(xmltype(p_doc_clob),'//wbody/*').getClobVal() INTO l_art_clob FROM dual;
1081: l_art_XML := p_art_clob.extract('//ArticleText[1]/*');
1082: select appendChildXML(XMLTYPE(l_art_clob),'//wbody',l_art_XML).getClobVal()
1083: into l_art_CLOB from dual;
1084: l_art_CLOB := OKC_WORD_DOWNLOAD_UPLOAD.resolve_variables_upload(l_art_CLOB);
1079: BEGIN
1080: SELECT deleteXML(xmltype(p_doc_clob),'//wbody/*').getClobVal() INTO l_art_clob FROM dual;
1081: l_art_XML := p_art_clob.extract('//ArticleText[1]/*');
1082: select appendChildXML(XMLTYPE(l_art_clob),'//wbody',l_art_XML).getClobVal()
1083: into l_art_CLOB from dual;
1084: l_art_CLOB := OKC_WORD_DOWNLOAD_UPLOAD.resolve_variables_upload(l_art_CLOB);
1085: l_art_CLOB := regexp_replace(regexp_replace(l_art_CLOB,'wbody','w:body'),'
1086:
1087: return OKC_WORD_DOWNLOAD_UPLOAD.clob_to_blob(l_art_clob);
1366: while (xmltype(l_art_html).existsnode('//wxsect')>0) loop
1367:
1368: l_tbl := '
1373: while (xmltype(l_art_html).existsnode('//wxsub-section')>0) loop
1374:
1375: l_tbl := '
1379: --Replace wml tables with html tables
1380: while (xmltype(l_art_html).existsnode('//wtbl')>0) loop
1381: l_tbl := '
1391: exception
1392: when others then
1393: l_tbl := '
1405: exception
1406: when others then
1407: l_tbl := '
1422: l_table := p_table;
1423: while (xmltype(l_table).existsnode('//wtr')>0) loop
1424: l_row := '
1440: exception
1441: when others then
1442: l_cell:='
1463: l_html_diff := XMLType(l_html_diff).extract('//P|//TABLESTART|//TABLEEND|//TRSTART|//TREND|//TD').getClobVal();
1464: --l_html_diff := '
1465: --l_html_diff := XMLType(l_html_diff).extract('//P|//TABLE').getClobVal();
1466: l_html_diff := '
1467: select deleteXML(XMLType(l_html_diff),'//br').getClobVal() into l_html_diff from dual;
1468: l_html_diff := regexp_replace(regexp_replace(regexp_replace(l_html_diff,'
1473: /*else
1474: l_html_diff := p_html_diff;
1475: end if;
1476: l_html_diff := '
1477: select deleteXML(XMLType(l_html_diff),'//br').getClobVal() into l_html_diff from dual;
1478: l_html_diff := XMLType(l_html_diff).extract('/DUMMY2/*').getClobVal();*/
1479: return l_html_diff;
1480: END clean_html_diff;
1481: