After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670208 - xsltEvalOneUserParam not working
xsltEvalOneUserParam not working
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
1.1.26
Other All
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-16 11:46 UTC by sam
Modified: 2021-07-05 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sam 2012-02-16 11:46:21 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
Comment 1 GNOME Infrastructure Team 2021-07-05 11:01:13 UTC
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.