Re: Issues using parameters with namespaces
George Joseph via xslt <[email protected]> Mon, 28 Feb 2022 14:01:14 -0700
| Newsgroups | gmane.comp.gnome.lib.xslt |
|---|---|
| Message-ID | <CAP=uFEuxqVL=Tu=22sqPmk=qeK-xKcBx0G4U8TKMt4XRLeO9LQ@mail.gmail.com> |
--===============2004766820146779180== Content-Type: multipart/alternative; boundary="0000000000004a3c3c05d91a5a61" --0000000000004a3c3c05d91a5a61 Content-Type: text/plain; charset="UTF-8" On Mon, Feb 28, 2022 at 1:04 PM Nick Wellnhofer <[email protected]> wrote: > On 28/02/2022 20:54, George Joseph via xslt wrote: > > I think it works because xsltProcessUserParamInternal only sets > > xpctxt->namespaces = NULL but it doesn't clear xpctxt->nsHash which is > where > > xmlXPathRegisterNs puts the namespaces to be registered. > > Right, the XPath engine uses both ->namespaces and ->nsHash. > > > Can you give me a hint? I've had absolutely no luck is trying to pass > a path > > as a string and getting it to result in something other than "The > 'select' > > expression > > did not evaluate to a node set" even in an absurdly simple example. I'm > passing > > the path double quoted "'/dm:device'" and have tried various > combinations of > > "select=" and "with-param". Even Google is failing me so any help > would be > > appreciated. > > I meant that you should only use string or integer literals in parameter > values and no other XPath expressions at all. This means to rework your > stylesheets, of course. > I think I'll stick with my solution to add the namespaces to the xpath context. :) Is there any reason why path parameters with namespaces haven't been supported? Would a pull request to add the namespaces in xsltNewTransformContext be considered? > > Nick > > --0000000000004a3c3c05d91a5a61 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">On Mon, Feb 28, 2022 at 1:04 PM Nick = Wellnhofer <<a href=3D"mailto:[email protected]">[email protected]</= a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p= x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On= 28/02/2022 20:54, George Joseph via xslt wrote:<br> >=C2=A0 =C2=A0I think it works because=C2=A0xsltProcessUserParamInternal= only sets<br> > xpctxt->namespaces =3D NULL but it doesn't clear xpctxt->nsH= ash which is where<br> > xmlXPathRegisterNs puts the namespaces to be registered.<br> <br> Right, the XPath engine uses both ->namespaces and ->nsHash.<br> <br> > Can you give me a hint?=C2=A0 =C2=A0I've had absolutely no luck is= trying to pass a path<br> > as a string and getting it to result in something other than "The= 'select' <br> > expression<br> > did not evaluate to a node set" even in an absurdly=C2=A0simple e= xample.=C2=A0 I'm passing<br> > the path double quoted "'/dm:device'" and have tried= various combinations of<br> > "select=3D" and "with-param".=C2=A0 =C2=A0 Even Go= ogle is failing me so any help would be <br> > appreciated.<br> <br> I meant that you should only use string or integer literals in parameter <b= r> values and no other XPath expressions at all. This means to rework your <br= > stylesheets, of course.<br></blockquote><div><br></div><div>I think I'l= l stick with my solution to add the namespaces to the xpath context. :)</di= v><div>Is there any reason why path parameters with namespaces haven't = been supported?</div><div>Would a pull request to add the namespaces in=C2= =A0xsltNewTransformContext=C2=A0be considered?</div><div><br></div><div><br= ></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0= px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br> Nick<br> <br> </blockquote></div></div> --0000000000004a3c3c05d91a5a61-- --===============2004766820146779180== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ xslt mailing list, project page http://xmlsoft.org/XSLT/ [email protected] https://mail.gnome.org/mailman/listinfo/xslt --===============2004766820146779180==--