how to maintain case of attribute name without changing to lower case in html agility pack

html-agility-pack

Question

i want to maintain case of attribute name without changing to lower case

when i load xml in HTMLAgility pack attribute name changed into lowercase like this

<Author affiliationids="Aff1" correspondingaffiliationid="Aff1"> i want output like this

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

Accepted Answer

You can't do this, unless you change the source (the Html Agility Pack is open source, so you're free to go). it's by design, as it was designed to handle HTML, and HTML is case-insensitive.


Popular Answer

It is now officially fixed and promised to be included in next release

As for now you can download source and build it yourself.

To prevent lowercase of all attributes use:

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



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why