Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > problem using xquery and asp.net

Reply
Thread Tools

problem using xquery and asp.net

 
 
amessimon
Guest
Posts: n/a
 
      03-07-2005
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




 
Reply With Quote
 
 
 
 
amessimon
Guest
Posts: n/a
 
      03-09-2005
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
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
obtain element name, or attribute and value of the document name itself, and some elemnts and attributes from an ancestor or the node itself using xquery Jeff Kish XML 4 10-30-2008 05:47 PM
Using XQuery Lynn XML 12 12-14-2007 05:29 AM
Update Query using XQuery CK XML 2 11-27-2006 09:43 PM
Simple aggregation using xquery Suma XML 4 07-24-2006 04:25 PM
XQuery using eXist Peter Saffrey XML 0 07-16-2004 03:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57