Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XQuery in ASP.net application

Status
Not open for further replies.

ma77c

Programmer
Jan 27, 2006
28
CA
Hi, I made a post in the XML forum, but since I haven't received any responses, I've decided this forum might be more appropriate.

I'm trying to run an XQuery against my XML document. I've been playing around with some code I got from a tutorial, but I am not always getting the expected results.

In Stylus Studio 2006, if I run the same query, I am able to get the expected results. This leads me to believe the problem has something to do with the way I am carrying out the XQuery in the code.

If anyone has any experience with XQueries in ASP.net, I would greatly appreciate your advice. Thanks!

Code:
Dim col As New XQueryNavigatorCollection()
col.AddNavigator(Server.MapPath("App_Data/supermemo.xml"), "supermemo")

Dim query As String
query = "for $x in document(""supermemo"")//entry " & _
        "return $x"

Dim expr As New XQueryExpression(query)
Dim xml As String = (expr.Execute(col)).ToXml()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top