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 Mike Lewis 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
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.
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top