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 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">

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

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.

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

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;


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