< prev index next >

modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/transform.c

Print this page
rev 11102 : 8227402: Improve XSLT processing
Reviewed-by: kcr, rhalade


3476     escURL=xmlURIEscapeStr(URL, BAD_CAST ":/.?,");
3477     if (escURL != NULL) {
3478         filename = xmlBuildURI(escURL, (const xmlChar *) ctxt->outputFile);
3479         xmlFree(escURL);
3480     }
3481     }
3482 
3483     if (filename == NULL) {
3484     xsltTransformError(ctxt, NULL, inst,
3485                  "xsltDocumentElem: URL computation failed for %s\n",
3486              URL);
3487     xmlFree(URL);
3488     return;
3489     }
3490 
3491     /*
3492      * Security checking: can we write to this resource
3493      */
3494     if (ctxt->sec != NULL) {
3495     ret = xsltCheckWrite(ctxt->sec, ctxt, filename);
3496     if (ret == 0) {

3497         xsltTransformError(ctxt, NULL, inst,
3498          "xsltDocumentElem: write rights for %s denied\n",
3499                  filename);
3500         xmlFree(URL);
3501         xmlFree(filename);
3502         return;
3503     }
3504     }
3505 
3506     oldOutputFile = ctxt->outputFile;
3507     oldOutput = ctxt->output;
3508     oldInsert = ctxt->insert;
3509     oldType = ctxt->type;
3510     ctxt->outputFile = (const char *) filename;
3511 
3512     style = xsltNewStylesheet();
3513     if (style == NULL) {
3514     xsltTransformError(ctxt, NULL, inst,
3515                          "xsltDocumentElem: out of memory\n");
3516         goto error;




3476     escURL=xmlURIEscapeStr(URL, BAD_CAST ":/.?,");
3477     if (escURL != NULL) {
3478         filename = xmlBuildURI(escURL, (const xmlChar *) ctxt->outputFile);
3479         xmlFree(escURL);
3480     }
3481     }
3482 
3483     if (filename == NULL) {
3484     xsltTransformError(ctxt, NULL, inst,
3485                  "xsltDocumentElem: URL computation failed for %s\n",
3486              URL);
3487     xmlFree(URL);
3488     return;
3489     }
3490 
3491     /*
3492      * Security checking: can we write to this resource
3493      */
3494     if (ctxt->sec != NULL) {
3495     ret = xsltCheckWrite(ctxt->sec, ctxt, filename);
3496     if (ret <= 0) {
3497             if (ret == 0)
3498                 xsltTransformError(ctxt, NULL, inst,
3499                      "xsltDocumentElem: write rights for %s denied\n",
3500                                  filename);
3501         xmlFree(URL);
3502         xmlFree(filename);
3503         return;
3504     }
3505     }
3506 
3507     oldOutputFile = ctxt->outputFile;
3508     oldOutput = ctxt->output;
3509     oldInsert = ctxt->insert;
3510     oldType = ctxt->type;
3511     ctxt->outputFile = (const char *) filename;
3512 
3513     style = xsltNewStylesheet();
3514     if (style == NULL) {
3515     xsltTransformError(ctxt, NULL, inst,
3516                          "xsltDocumentElem: out of memory\n");
3517         goto error;


< prev index next >