Giter VIP home page Giter VIP logo

Comments (5)

jods4 avatar jods4 commented on August 23, 2024

I'm working on this.
Do you happen to know why validation of attribute values is disabled?
https://github.com/mamift/LinqToXsdCore/blob/master/XObjectsCode/Src/ClrPropertyInfo.cs#L868

(not gonna change this in the PR but it struck me as odd?)

from linqtoxsdcore.

jods4 avatar jods4 commented on August 23, 2024

It also struck me as odd that the ToString call on enums is only on the xNameParm branches.
https://github.com/mamift/LinqToXsdCore/blob/master/XObjectsCode/Src/ClrPropertyInfo.cs#L928

xNameParm actually indicates whether the origin of the value is element/attribute vs text content.
When xNameParm is false, the the origin is text content and SetValue is called.
https://github.com/mamift/LinqToXsdCore/blob/master/XObjectsCode/Src/ClrPropertyInfo.cs#L872-L875

Should that text content be typed as an enum, I don't see why it shouldn't be formatted ToString the same way it would be in an attribute or child element.
I'm changing this as it seems like a logical thing to do + it makes my new code easier.

from linqtoxsdcore.

jods4 avatar jods4 commented on August 23, 2024

Done in #28, as well as another NRE crash unrelated to validation when setting nullable enum attributes.

from linqtoxsdcore.

mamift avatar mamift commented on August 23, 2024

I'm working on this.
Do you happen to know why validation of attribute values is disabled?
https://github.com/mamift/LinqToXsdCore/blob/master/XObjectsCode/Src/ClrPropertyInfo.cs#L868

(not gonna change this in the PR but it struck me as odd?)

I know I'm replying after the fact, but to address your question, no I don't know why. But agree with your change, and that it's odd.

from linqtoxsdcore.

jods4 avatar jods4 commented on August 23, 2024

Just to be sure there is no misunderstanding:

But agree with your change

I left attribute validation disabled as I was afraid of the reason why it was disabled in the first place:
https://github.com/mamift/LinqToXsdCore/blob/master/XObjectsCode/Src/ClrPropertyInfo.cs#L871

from linqtoxsdcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.