Re: [xslt] Issues using parameters with namespaces

On 28/02/2022 18:50, George Joseph via xslt wrote:
I've been having a heck of a time trying to pass a parameter to xsltApplyStylesheet
that has namespaces in the xpath expression.

This use case is simply not supported.

Finally I did find a workaround by calling xsltNewTransformContext() then iterating
over the nsDefs in the stylesheet document and calling xmlXPathRegisterNs on
ctxt->xpathCtxt for each nsDef.

I'm a bit puzzled that this worked at all. See the code here:

But the expression is compiled before resetting the namespaces, so I guess that's why.

I would have thought this would have been done automatically though.  Did I
miss something or is there a better way to do this?

No, I'd recommend that you only use string and integer params.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]