Reading html tag Using Xml reader

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Varatharaju
    New Member
    • Nov 2014
    • 3

    #1

    Reading html tag Using Xml reader

    Hi Everyone, I need to know how to parse the html tag using xmlreader.

    This is my input. How to parse this input html file
    <html> <body> <p><b><i>Hell o</b>World</i></p> </body> </html>
  • Varatharaju
    New Member
    • Nov 2014
    • 3

    #2
    If anyone knows the answer kindly tell me

    Comment

    • Luuk
      Recognized Expert Top Contributor
      • Mar 2012
      • 1043

      #3
      Googling found:


      which leads to:


      Which raises the question: What is so hard that you cannot Google for it yourself? or is information missing on the given links here?

      And a bit patience would help too, so your second post (2 hours after the 1st post) is RUDE.

      Comment

      • Varatharaju
        New Member
        • Nov 2014
        • 3

        #4
        Mr Luuk thanks for ur reply, i too found that link. But i need to parse the Html file using only the xmlreader not by the xmltextreader.

        I got the output for the input file

        <p><b>Hello<i>W orld<u>Good</u></i>Morning</b></p>

        but i dont know how to parse the html file when the below input comes

        <p><b>Hellow<i> World</b><u>Good</i>Morning</u></p>

        look at my starting and ending tags.

        that is what m problem. If u know plz tell me.

        Comment

        • Kara Hewett
          New Member
          • Apr 2014
          • 27

          #5
          Hi

          HtmlAgilityPack and regular expressions can be used to parse HTML very effectively. HTML can be formatted using "classes". You can then parse on the class such as:

          XPathValues = "//table[@class='c123']//tr/td";
          HtmlDocument doc = doc.DocumentNod e.SelectNodes(X PathValues);


          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Varatharaju,

            Please check out the MSDN documentation for the XMLReader Class. If you scroll down past all of the property, method, and event documentation details there are examples and additional information about how to use the class (just follow the link).

            -Frinny

            Comment

            Working...