I want to parse HTML (you can assume as a XML, converted via Tidy) and get all the text nodes (which means nodes in Body tag that are visible) and their location in the XML file. Location means the text position in the flat XML file.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
XmlTextReaderimplementsIXmlLineInfo– if you look at the docs forIXmlLineInfoit gives an example of reading an XML file and reporting the location of each node.EDIT: For those saying it’s irrelevant, it may well be irrelevant to the XML – but quite possibly not to a human. If you’re trying to tell people where to look in the XML for particular bits, it can be very helpful to report line numbers and positions.