GNOME Bugzilla – Bug 670208
xsltEvalOneUserParam not working
Last modified: 2021-07-05 11:01:13 UTC
xsltEvalOneUserParam() is not working, without playing with member values of internal structure - xsltTransformContext. Example code: xctxt = xsltNewTransformContext(stylesheet, doc); xsltEvalOneUserParam(xctxt, name, value); In this xsltEvalOneUserParam() will always return null for all XPATH expressions specified in variable value. Reason for this seem to be unset initialContextDoc and initialContextNode members of xsltTransformContext structure. If code modified like this: xctxt = xsltNewTransformContext(stylesheet, doc); // stolen from xsltApplyStylesheetInternal() xctxt->initialContextDoc = doc; xctxt->initialContextNode = (xmlNodePtr) doc; xsltEvalOneUserParam(xctxt, name, value); everything works ok. But, this unfortunately touches members of structure that is not part of API (http://xmlsoft.org/XSLT/html/libxslt-xsltInternals.html), and therefore is possibly non-portable. Reason why xsltEvalOneUserParam() works correctly in xsltApplyStylesheet*() is that, this function sets initialContextDoc/Node members after creating context. IMHO xsltNewTransformContext() function should set it when creating context... Thanks
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxslt/-/issues/ Thank you for your understanding and your help.