< prev index next >

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

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


 113     res = style;
 114     while (res != NULL) {
 115         if (res->doc == NULL)
 116         break;
 117     if (xmlStrEqual(res->doc->URL, URI)) {
 118         xsltTransformError(NULL, style, cur,
 119            "xsl:import : recursion detected on imported URL %s\n", URI);
 120         goto error;
 121     }
 122     res = res->parent;
 123     }
 124 
 125     /*
 126      * Security framework check
 127      */
 128     sec = xsltGetDefaultSecurityPrefs();
 129     if (sec != NULL) {
 130     int secres;
 131 
 132     secres = xsltCheckRead(sec, NULL, URI);
 133     if (secres == 0) {

 134         xsltTransformError(NULL, NULL, NULL,
 135          "xsl:import: read rights for %s denied\n",
 136                  URI);
 137         goto error;
 138     }
 139     }
 140 
 141     import = xsltDocDefaultLoader(URI, style->dict, XSLT_PARSE_OPTIONS,
 142                                   (void *) style, XSLT_LOAD_STYLESHEET);
 143     if (import == NULL) {
 144     xsltTransformError(NULL, style, cur,
 145         "xsl:import : unable to load %s\n", URI);
 146     goto error;
 147     }
 148 
 149     res = xsltParseStylesheetImportedDoc(import, style);
 150     if (res != NULL) {
 151     res->next = style->imports;
 152     style->imports = res;
 153     if (style->parent == NULL) {




 113     res = style;
 114     while (res != NULL) {
 115         if (res->doc == NULL)
 116         break;
 117     if (xmlStrEqual(res->doc->URL, URI)) {
 118         xsltTransformError(NULL, style, cur,
 119            "xsl:import : recursion detected on imported URL %s\n", URI);
 120         goto error;
 121     }
 122     res = res->parent;
 123     }
 124 
 125     /*
 126      * Security framework check
 127      */
 128     sec = xsltGetDefaultSecurityPrefs();
 129     if (sec != NULL) {
 130     int secres;
 131 
 132     secres = xsltCheckRead(sec, NULL, URI);
 133     if (secres <= 0) {
 134             if (secres == 0)
 135                 xsltTransformError(NULL, NULL, NULL,
 136                      "xsl:import: read rights for %s denied\n",
 137                                  URI);
 138         goto error;
 139     }
 140     }
 141 
 142     import = xsltDocDefaultLoader(URI, style->dict, XSLT_PARSE_OPTIONS,
 143                                   (void *) style, XSLT_LOAD_STYLESHEET);
 144     if (import == NULL) {
 145     xsltTransformError(NULL, style, cur,
 146         "xsl:import : unable to load %s\n", URI);
 147     goto error;
 148     }
 149 
 150     res = xsltParseStylesheetImportedDoc(import, style);
 151     if (res != NULL) {
 152     res->next = style->imports;
 153     style->imports = res;
 154     if (style->parent == NULL) {


< prev index next >