Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 560
kalai Avatar asked Jun 14 '11 07:06

kalai


2 Answers

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;
like image 61
Mak Sim Avatar answered Oct 23 '22 09:10

Mak Sim


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.

like image 32
Simon Mourier Avatar answered Oct 23 '22 09:10

Simon Mourier