From: Daniel Veillard Date: Mon, 1 Sep 2003 21:03:32 +0000 (+0000) Subject: patch from Mark Vadoc to allow compiling against libxml2 without XPointer X-Git-Tag: v1.1.28~607 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6979d8c42682f59f2bbc877927056f0e74baac30;p=platform%2Fupstream%2Flibxslt.git patch from Mark Vadoc to allow compiling against libxml2 without XPointer * libxslt/function.c: patch from Mark Vadoc to allow compiling against libxml2 without XPointer supoort. Daniel --- diff --git a/ChangeLog b/ChangeLog index 0baad8b..45c639b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Sep 1 23:02:12 CEST 2003 Daniel Veillard + + * libxslt/function.c: patch from Mark Vadoc to allow compiling + against libxml2 without XPointer supoort. + Fri Aug 29 12:28:12 CEST 2003 Daniel Veillard * libxslt/transform.c: fixing the bug #120971 on cdata-section-elements diff --git a/libxslt/functions.c b/libxslt/functions.c index 1954f7b..e66622c 100644 --- a/libxslt/functions.c +++ b/libxslt/functions.c @@ -106,8 +106,8 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI) xmlChar *fragment; xsltDocumentPtr xsltdoc; xmlDocPtr doc; - xmlXPathContextPtr xptrctxt; - xmlXPathObjectPtr object; + xmlXPathContextPtr xptrctxt = NULL; + xmlXPathObjectPtr object = NULL; tctxt = xsltXPathGetTransformContext(ctxt); if (tctxt == NULL) { @@ -161,7 +161,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI) } /* use XPointer of HTML location for fragment ID */ - +#ifdef LIBXML_XPTR_ENABLED xptrctxt = xmlXPtrNewContext(doc, NULL, NULL); if (xptrctxt == NULL) { xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL, @@ -170,8 +170,10 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI) } object = xmlXPtrEval(fragment, xptrctxt); +#endif xmlFree(fragment); - xmlXPathFreeContext(xptrctxt); + if (xptrctxt != NULL) + xmlXPathFreeContext(xptrctxt); if (object == NULL) goto out_fragment;