rich kopelow
V.I.P
Posts: 47
Joined: Thu Aug 25, 2016 7:45 am

case sensitive Attribute("inc"); [SOLVED]

Sat Apr 21, 2018 3:16 am

More of a "release note" than a bug re: var incAttr = adapterNode.Element.Attribute("inc");
In 3.0.0-rc? this appeared to have been case insensitive. In 3.0.0 it appears to be case sensitive.

Thanks,
Rich.

User avatar
Fantom
Help & Support
Posts: 307
Joined: Fri Oct 25, 2013 9:20 pm

Re: case sensitive Attribute("inc");

Sat Apr 21, 2018 11:17 am

XElement.Attribute(string) is case sensitive so no changes can be made to the implementation by us as it is a standard .NET implementation. I am confused why it was case insensitive for you in 3.0.0-rc :?

rich kopelow
V.I.P
Posts: 47
Joined: Thu Aug 25, 2016 7:45 am

Re: case sensitive Attribute("inc");

Sun Apr 22, 2018 3:34 am

It is strange - maybe the elves were messing with my siml, I mean, SIML.
As we discussed in the adapter thread, I was using a foreach/switch to unpack attributes in general. I was using a ToLower() in my switch statement and this was working fine. In one of my adapters, in which I only ever unpack one attribute, I switched over to your approach (i.e. var counter = adapterNode.Element.Attribute("counter");) and that was also working just fine. Then 3.0.0 came out and I updated my project and that adapter failed (globally). In debug when I saw I didn't get an attribute, I tried with upper case and it worked, which lead me to do

CSharp Code

string counter = adapterNode.Element.Attributes().SingleOrDefault(a=>a.Name.LocalName.ToLower()=="counter")?.Value; 
Not something I'd do if I had more than one attribute. I could of course change "counter" to "Counter", but I'm hoping to encourage more people to write SIML (I guess I'm trying to get them to write SIML-ish) not try to make their lives harder.

Anyway, thanks as always for the info,
Rich.

Return to “Report Bugs and Issues”

Who is online

Users browsing this forum: No registered users and 3 guests