Re: [xml] Return type of the xpath query during the compilation of xpath



On Thu, May 29, 2008 at 09:57:06AM +0530, Umesh Chandak wrote:
Hi ,
    I want to know is there any way in libxml xpath to come to know the 
return type of the xpath query. I know that there is a way to determine 
the return type of the  xpath query after evaluation but for my purpose 
I want to know this return type at compilation time .
    If there is no way then can any point to me how it can be done in 
libxml xpath.

  There is no way in libxml2, we didn't try to provide this informations.
I also don't think it's possible in all cases since XPath alllows the
support for vairables. See the introduction of the spec:

 "The value of a variable is an object, which can be of any of the types
  that are possible for the value of an expression, and may also be of
  additional types not specified here."

  "$foo" is a correct XPath expression, you can't determine its type
statically at compile time since variable definitions are available only
during evaluation.

  Without variable this is probably possible, nobody asked for it so far,
and this is not present in libxml2.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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