< prev index next >

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

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


6746     xmlDocPtr doc;
6747 
6748     xsltInitGlobals();
6749 
6750     if (filename == NULL)
6751     return(NULL);
6752 
6753 #ifdef WITH_XSLT_DEBUG_PARSING
6754     xsltGenericDebug(xsltGenericDebugContext,
6755         "xsltParseStylesheetFile : parse %s\n", filename);
6756 #endif
6757 
6758     /*
6759      * Security framework check
6760      */
6761     sec = xsltGetDefaultSecurityPrefs();
6762     if (sec != NULL) {
6763     int res;
6764 
6765     res = xsltCheckRead(sec, NULL, filename);
6766     if (res == 0) {

6767         xsltTransformError(NULL, NULL, NULL,
6768          "xsltParseStylesheetFile: read rights for %s denied\n",
6769                  filename);
6770         return(NULL);
6771     }
6772     }
6773 
6774     doc = xsltDocDefaultLoader(filename, NULL, XSLT_PARSE_OPTIONS,
6775                                NULL, XSLT_LOAD_START);
6776     if (doc == NULL) {
6777     xsltTransformError(NULL, NULL, NULL,
6778         "xsltParseStylesheetFile : cannot parse %s\n", filename);
6779     return(NULL);
6780     }
6781     ret = xsltParseStylesheetDoc(doc);
6782     if (ret == NULL) {
6783     xmlFreeDoc(doc);
6784     return(NULL);
6785     }
6786 




6746     xmlDocPtr doc;
6747 
6748     xsltInitGlobals();
6749 
6750     if (filename == NULL)
6751     return(NULL);
6752 
6753 #ifdef WITH_XSLT_DEBUG_PARSING
6754     xsltGenericDebug(xsltGenericDebugContext,
6755         "xsltParseStylesheetFile : parse %s\n", filename);
6756 #endif
6757 
6758     /*
6759      * Security framework check
6760      */
6761     sec = xsltGetDefaultSecurityPrefs();
6762     if (sec != NULL) {
6763     int res;
6764 
6765     res = xsltCheckRead(sec, NULL, filename);
6766     if (res <= 0) {
6767             if (res == 0)
6768                 xsltTransformError(NULL, NULL, NULL,
6769                      "xsltParseStylesheetFile: read rights for %s denied\n",
6770                                  filename);
6771         return(NULL);
6772     }
6773     }
6774 
6775     doc = xsltDocDefaultLoader(filename, NULL, XSLT_PARSE_OPTIONS,
6776                                NULL, XSLT_LOAD_START);
6777     if (doc == NULL) {
6778     xsltTransformError(NULL, NULL, NULL,
6779         "xsltParseStylesheetFile : cannot parse %s\n", filename);
6780     return(NULL);
6781     }
6782     ret = xsltParseStylesheetDoc(doc);
6783     if (ret == NULL) {
6784     xmlFreeDoc(doc);
6785     return(NULL);
6786     }
6787 


< prev index next >