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

Unified Diff: third_party/libxslt/libexslt/strings.c

Issue 661058: libxslt update (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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/libexslt/sets.c ('k') | third_party/libxslt/libxslt.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libexslt/strings.c
===================================================================
--- third_party/libxslt/libexslt/strings.c (revision 39981)
+++ third_party/libxslt/libexslt/strings.c (working copy)
@@ -589,15 +589,14 @@
}
str = xmlXPathPopString(ctxt);
- ret = xmlStrdup(str);
+ ret = xmlStrdup(str);
- for (i = 0; i < searchSet->nodeNr; i++) {
+ for (i = 0; i < searchSet->nodeNr; i++) {
+ searchStr = xmlXPathCastNodeToString(searchSet->nodeTab[i]);
- searchStr = xmlXPathCastNodeToString(searchSet->nodeTab[i]);
-
if (replaceSet != NULL) {
replaceStr = NULL;
- if (i <= replaceSet->nodeNr) {
+ if (i < replaceSet->nodeNr) {
replaceStr = xmlXPathCastNodeToString(replaceSet->nodeTab[i]);
}
@@ -674,3 +673,45 @@
EXSLT_STRINGS_NAMESPACE,
exsltStrReplaceFunction);
}
+
+/**
+ * exsltStrXpathCtxtRegister:
+ *
+ * Registers the EXSLT - Strings module for use outside XSLT
+ */
+int
+exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
+{
+ if (ctxt
+ && prefix
+ && !xmlXPathRegisterNs(ctxt,
+ prefix,
+ (const xmlChar *) EXSLT_STRINGS_NAMESPACE)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "encode-uri",
+ (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+ exsltStrEncodeUriFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "decode-uri",
+ (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+ exsltStrDecodeUriFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "padding",
+ (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+ exsltStrPaddingFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "align",
+ (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+ exsltStrAlignFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "concat",
+ (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+ exsltStrConcatFunction)
+ && !xmlXPathRegisterFuncNS(ctxt,
+ (const xmlChar *) "replace",
+ (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
+ exsltStrReplaceFunction)) {
+ return 0;
+ }
+ return -1;
+}
« no previous file with comments | « third_party/libxslt/libexslt/sets.c ('k') | third_party/libxslt/libxslt.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698