When I run the following XQuery in Stylus Studio 2006 I get the expected XML output. However, when I use the same query in the .net application, the XML is butchered and drastically different.
This is the code I am using the run the query.
I don't know if this is even the best way to go about it. If anyone can see why I might be getting different output or suggest a better way to execute an XQuery is ASP.net, I'm open to all ideas.
This is the code I am using the run the query.
Code:
Dim col As New XQueryNavigatorCollection()
col.AddNavigator(Server.MapPath("App_Data/supermemo.xml"), "supermemo")
Dim query As String
query = "<supermemo>" & _
"{" & _
"for $entry in document(""supermemo"")//entry " & _
"where contains($entry/header/entryTitle,""" & txtSearch.Text() & """) " & _
"return $entry" & _
"}" & _
"</supermemo>"
Dim expr As New XQueryExpression(query)
Dim rawXML As String = (expr.Execute(col)).ToXml()
I don't know if this is even the best way to go about it. If anyone can see why I might be getting different output or suggest a better way to execute an XQuery is ASP.net, I'm open to all ideas.