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!
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()