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

Unified Diff: third_party/libxslt/libxslt/functions.c

Issue 2777943003: Roll libxslt to ac341cbd792ee572941cc9a66e73800219a1a386 (Closed)
Patch Set: Update README.chromium. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxslt/libxslt/extra.c ('k') | third_party/libxslt/libxslt/libxslt.syms » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libxslt/functions.c
diff --git a/third_party/libxslt/libxslt/functions.c b/third_party/libxslt/libxslt/functions.c
index ec22203f4ca21f7ac5ac13da4b39695e22466fa0..5cc9da59244e6e49f56fb9fbb4537fe5eda7d7d7 100644
--- a/third_party/libxslt/libxslt/functions.c
+++ b/third_party/libxslt/libxslt/functions.c
@@ -603,12 +603,15 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
xmlXPathObjectPtr formatObj = NULL;
xmlXPathObjectPtr decimalObj = NULL;
xsltStylesheetPtr sheet;
- xsltDecimalFormatPtr formatValues;
+ xsltDecimalFormatPtr formatValues = NULL;
xmlChar *result;
+ const xmlChar *ncname;
+ const xmlChar *prefix = NULL;
+ const xmlChar *nsUri = NULL;
xsltTransformContextPtr tctxt;
tctxt = xsltXPathGetTransformContext(ctxt);
- if (tctxt == NULL)
+ if ((tctxt == NULL) || (tctxt->inst == NULL))
return;
sheet = tctxt->style;
if (sheet == NULL)
@@ -619,7 +622,21 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
case 3:
CAST_TO_STRING;
decimalObj = valuePop(ctxt);
- formatValues = xsltDecimalFormatGetByName(sheet, decimalObj->stringval);
+ ncname = xsltSplitQName(sheet->dict, decimalObj->stringval, &prefix);
+ if (prefix != NULL) {
+ xmlNsPtr ns = xmlSearchNs(tctxt->inst->doc, tctxt->inst, prefix);
+ if (ns == NULL) {
+ xsltTransformError(tctxt, NULL, NULL,
+ "format-number : No namespace found for QName '%s:%s'\n",
+ prefix, ncname);
+ sheet->errors++;
+ ncname = NULL;
+ }
+ nsUri = ns->href;
+ }
+ if (ncname != NULL) {
+ formatValues = xsltDecimalFormatGetByQName(sheet, nsUri, ncname);
+ }
if (formatValues == NULL) {
xsltTransformError(tctxt, NULL, NULL,
"format-number() : undeclared decimal format '%s'\n",
« no previous file with comments | « third_party/libxslt/libxslt/extra.c ('k') | third_party/libxslt/libxslt/libxslt.syms » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698