Re: [xslt] XSLT equivalent to xmlXPathEval?

On Thu, Feb 21, 2002 at 05:34:09PM -0600, Matt Cruikshank wrote:
> Greetings -
> I had been executing the following :
> xmlXPathObjectPtr nodeList = xmlXPathEval("//employee [name=\"louis\"]/job",
> context);
> With correct results.  Now I found out that some people are using my
> function like this :
> xmlXPathObjectPtr nodeList = xmlXPathEval("//employee [$any$
> name=\"louis\"]/job", context);
> That extra $any$ is ruining the xmlXPathEval.  Here is the message I get out
> :
>      Error C:\home\igor\src\gnome-xml\xpath.c:7497: Invalid predicate
>      //employee [$any$ name="louis"]/job
>                      ^
>      xmlXPathEval: evaluation failed

  Right xmlXPathEval implements the XPath 1.0 Language
And that construct is not allowed by that language.

> Looking in the books that I have, I see that $any$ is an XSL operator.  I

  Maybe, maybe not. It doesn't matter anyway.

> haven't been able to figure out how to do a single XSL evaluation in XSLT.
> What function in XSLT do I call that's roughly equivalent to xmlXPathEval,
> but understands operators like $any$?

  $any$ is not part of the XPath syntax. XSLT uses the XPath syntax, 
the syntax you're showing cannot be handled by libxml2 XPath engine nor by
libxslt XSLT 1.0 implementation.


Daniel Veillard      | Red Hat Network  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

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