Search Xml
-
im building a web page and i want to be able to search an xml file please help thanks:-D Da Intern
-
im building a web page and i want to be able to search an xml file please help thanks:-D Da Intern
You'll need to ask a more detailed question if you want help. What do you need help with?
-
You'll need to ask a more detailed question if you want help. What do you need help with?
i have an xml file that a user creates and i want them to be able to search the whole xml file with a text box i am doing it in asp.net vb if you could help me i would greatly appreicate it Thanks:-D Da Intern
-
i have an xml file that a user creates and i want them to be able to search the whole xml file with a text box i am doing it in asp.net vb if you could help me i would greatly appreicate it Thanks:-D Da Intern
The first problem is you are using VB.NET ;P You still haven't said what the user is searching. Nodes, attributes, text??? Do some research on XPath.
-
The first problem is you are using VB.NET ;P You still haven't said what the user is searching. Nodes, attributes, text??? Do some research on XPath.
lol.......yea i don't like it that much either but im tryin to learn it I'm searching for text in individual elements im a c# person Da Intern
-
lol.......yea i don't like it that much either but im tryin to learn it I'm searching for text in individual elements im a c# person Da Intern
in c#:
String searchTerm = "hello, world"; String queryString = "//*[contains('" + searchTerm + "')]"; XmlNodeList results = document.SelectNodes(queryString);
"When the only tool you have is a hammer, a sore thumb you will have."
-
in c#:
String searchTerm = "hello, world"; String queryString = "//*[contains('" + searchTerm + "')]"; XmlNodeList results = document.SelectNodes(queryString);
"When the only tool you have is a hammer, a sore thumb you will have."
as you can see i translated it to vb:
Dim searchTerm As String = "hello, world" Dim results As XmlNodeList Dim queryString As String = "//*[contains('" & searchTerm & "')]" Dim xmldoc As New XmlDocument() xmldoc.Load("guestbook.xml") results = xmldoc.DocumentElement.SelectNodes(queryString) Response.Write(results)
but why do i keep gettin this error: Function 'contains' in '//*[contains(bug)]' has invalid number of arguments. also how else can i write it out other than response.write thanks for the help Da Intern