Sorted it, was a simple typo
replace 'doc(""foo"")' with 'document(""foo"")'
"amessimon" <amessimon_n_o_s_p_a_m_@hotmail.com> wrote in message
news:s7XWd.87$...
> Hi
>
> I'm having a problem querying an XML document using Xquery, i dont know if
> this is the right place to post, but i couldnt find an xquery newsgroup.
> Ive also posted in the xml group. Ive not used xquery before and cant find
> much documentation online regarding the problem i am encountering.
>
> Im running the following code, which is a simple query....(ive included
> all of it as its short and for the sake of completeness).
>
> ################################################## ######
>
> <%@ Import Namespace="System.Xml" %>
> <%@ Import Namespace="Microsoft.Xml.XQuery" %>
> <%@ Import NameSpace="System.IO" %>
> <script language="vb" runat="server">
> Sub page_load()
> Dim col as New XQueryNavigatorCollection()
> col.AddNavigator(server.mappath("test.xml"), "foo")
> Dim query as String
> query = "for $x in doc(""foo"")/SEARCHRESULTS/RESULTSET/RESULT " & _
> "where $x/URL = ""somestring"" " & _
> "return $x/REDIR"
> Dim expr as New XQueryExpression(query)
> Dim rawXML as String = (expr.Execute(col)).ToXml()
> End sub
> </script>
>
> ################################################## ######
>
> This returns the following exception
>
> "Microsoft.Xml.XQuery.XQueryException: User Defined Functions not
> supported. "
>
> Im puzzled as to why this is as I can see nothing wrong with the query?
>
> Thanks for any advice in advance
>
> amessimon
>
>
>
>
|