Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Search Xml

Search Xml

Scheduled Pinned Locked Moved XML / XSL
xmlhelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jphuphilly
    wrote on last edited by
    #1

    im building a web page and i want to be able to search an xml file please help thanks:-D Da Intern

    N 1 Reply Last reply
    0
    • J jphuphilly

      im building a web page and i want to be able to search an xml file please help thanks:-D Da Intern

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      You'll need to ask a more detailed question if you want help. What do you need help with?

      J 1 Reply Last reply
      0
      • N Not Active

        You'll need to ask a more detailed question if you want help. What do you need help with?

        J Offline
        J Offline
        jphuphilly
        wrote on last edited by
        #3

        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

        N 1 Reply Last reply
        0
        • J jphuphilly

          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

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          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.

          J 1 Reply Last reply
          0
          • N Not Active

            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.

            J Offline
            J Offline
            jphuphilly
            wrote on last edited by
            #5

            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

            P 1 Reply Last reply
            0
            • J jphuphilly

              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

              P Offline
              P Offline
              Philip Fitzsimons
              wrote on last edited by
              #6

              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."

              J 1 Reply Last reply
              0
              • P Philip Fitzsimons

                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."

                J Offline
                J Offline
                jphuphilly
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups