Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: third_party/libxslt/libxslt/xslt.c

Issue 1848793005: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libxslt/libxslt/win32config.h ('k') | third_party/libxslt/libxslt/xsltInternals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * xslt.c: Implemetation of an XSL Transformation 1.0 engine 2 * xslt.c: Implemetation of an XSL Transformation 1.0 engine
3 * 3 *
4 * Reference: 4 * Reference:
5 * XSLT specification 5 * XSLT specification
6 * http://www.w3.org/TR/1999/REC-xslt-19991116 6 * http://www.w3.org/TR/1999/REC-xslt-19991116
7 * 7 *
8 * Associating Style Sheets with XML documents 8 * Associating Style Sheets with XML documents
9 * http://www.w3.org/1999/06/REC-xml-stylesheet-19990629 9 * http://www.w3.org/1999/06/REC-xml-stylesheet-19990629
10 * 10 *
(...skipping 5364 matching lines...) Expand 10 before | Expand all | Expand 10 after
5375 prop = xmlGetNsProp(template, (const xmlChar *)"priority", NULL); 5375 prop = xmlGetNsProp(template, (const xmlChar *)"priority", NULL);
5376 if (prop != NULL) { 5376 if (prop != NULL) {
5377 priority = xmlXPathStringEvalNumber(prop); 5377 priority = xmlXPathStringEvalNumber(prop);
5378 ret->priority = (float) priority; 5378 ret->priority = (float) priority;
5379 xmlFree(prop); 5379 xmlFree(prop);
5380 } 5380 }
5381 5381
5382 prop = xmlGetNsProp(template, (const xmlChar *)"name", NULL); 5382 prop = xmlGetNsProp(template, (const xmlChar *)"name", NULL);
5383 if (prop != NULL) { 5383 if (prop != NULL) {
5384 const xmlChar *URI; 5384 const xmlChar *URI;
5385 xsltTemplatePtr cur;
5386 5385
5387 /* 5386 /*
5388 * TODO: Don't use xsltGetQNameURI(). 5387 * TODO: Don't use xsltGetQNameURI().
5389 */ 5388 */
5390 URI = xsltGetQNameURI(template, &prop); 5389 URI = xsltGetQNameURI(template, &prop);
5391 if (prop == NULL) { 5390 if (prop == NULL) {
5392 if (style != NULL) style->errors++; 5391 if (style != NULL) style->errors++;
5393 goto error; 5392 goto error;
5394 } else { 5393 } else {
5395 if (xmlValidateNCName(prop,0)) { 5394 if (xmlValidateNCName(prop,0)) {
5396 xsltTransformError(NULL, style, template, 5395 xsltTransformError(NULL, style, template,
5397 "xsl:template : error invalid name '%s'\n", prop); 5396 "xsl:template : error invalid name '%s'\n", prop);
5398 if (style != NULL) style->errors++; 5397 if (style != NULL) style->errors++;
5399 goto error; 5398 goto error;
5400 } 5399 }
5401 ret->name = xmlDictLookup(style->dict, BAD_CAST prop, -1); 5400 ret->name = xmlDictLookup(style->dict, BAD_CAST prop, -1);
5402 xmlFree(prop); 5401 xmlFree(prop);
5403 prop = NULL; 5402 prop = NULL;
5404 if (URI != NULL) 5403 if (URI != NULL)
5405 ret->nameURI = xmlDictLookup(style->dict, BAD_CAST URI, -1); 5404 ret->nameURI = xmlDictLookup(style->dict, BAD_CAST URI, -1);
5406 else 5405 else
5407 ret->nameURI = NULL; 5406 ret->nameURI = NULL;
5408 cur = ret->next;
5409 while (cur != NULL) {
5410 if ((URI != NULL && xmlStrEqual(cur->name, ret->name) &&
5411 xmlStrEqual(cur->nameURI, URI) ) ||
5412 (URI == NULL && cur->nameURI == NULL &&
5413 xmlStrEqual(cur->name, ret->name))) {
5414 xsltTransformError(NULL, style, template,
5415 "xsl:template: error duplicate name '%s'\n", ret->name);
5416 style->errors++;
5417 goto error;
5418 }
5419 cur = cur->next;
5420 }
5421 } 5407 }
5422 } 5408 }
5423 5409
5424 /* 5410 /*
5425 * parse the content and register the pattern 5411 * parse the content and register the pattern
5426 */ 5412 */
5427 xsltParseTemplateContent(style, template); 5413 xsltParseTemplateContent(style, template);
5428 ret->elem = template; 5414 ret->elem = template;
5429 ret->content = template->children; 5415 ret->content = template->children;
5430 xsltAddTemplate(style, ret, ret->mode, ret->modeURI); 5416 xsltAddTemplate(style, ret, ret->mode, ret->modeURI);
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
7002 ret = xsltParseStylesheetFile(href); 6988 ret = xsltParseStylesheetFile(href);
7003 } 6989 }
7004 if (base != NULL) 6990 if (base != NULL)
7005 xmlFree(base); 6991 xmlFree(base);
7006 } 6992 }
7007 xmlFreeURI(URI); 6993 xmlFreeURI(URI);
7008 xmlFree(href); 6994 xmlFree(href);
7009 } 6995 }
7010 return(ret); 6996 return(ret);
7011 } 6997 }
OLDNEW
« no previous file with comments | « third_party/libxslt/libxslt/win32config.h ('k') | third_party/libxslt/libxslt/xsltInternals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698