In HTML agility pack, how can I keep the case of an attribute name without altering it to lower case?

html-agility-pack

Question

I don't want the attribute name's case to change to lower case.

Attribute names converted to lowercase when I loaded XML into HTMLAgility Pack, as seen below.

<Author affiliationids="Aff1" correspondingaffiliationid="Aff1"> I need results like these

<Author AffiliationIDS="Aff1" CorrespondingAffiliationID="Aff1">

1
5
6/14/2011 7:00:00 AM

Accepted Answer

Unless you edit the source, which is not possible since the HTML Agility Pack is an open source project. Since HTML is case-insensitive and was intended to handle HTML, it is by design.

1
6/14/2011 8:47:18 AM

Popular Answer

Now that it has been officially fixed, vowed to be included to the next release

For the time being, you may build it yourself from the download source.

Use: to avoid using lowercase for any attribute.

HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
document.OptionOutputOriginalCase = true;


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow