I am using the HTML Agility Pack to great effect, and am really impressed with it - However, I am selecting content like so
doc.DocumentNode.SelectSingleNode("//body").InnerHtml
How to I deal with the following situation, with different documents?
<body>
<Body>
<BODY>
Will my code above only get the lower case versions?
The Html Agility Pack handles HTML in a case insensitive way. It means it will parse BODY, Body and body the same way. It's by design since HTML is not case sensitive (XHTML is).
That said, when you use its XPATH feature, you must use tags written in lower case. It means the "//body"
expression will match BODY, Body and body, and "//BODY" will match nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With