Coder Social home page Coder Social logo

Comments (6)

shmsr avatar shmsr commented on June 12, 2024

@droyo did you find some time to look into this?

from go-xml.

droyo avatar droyo commented on June 12, 2024

The error you're getting is because there is no entry for xsd.AnySimpleType in builtinTbl. You should be able to add an entry and give it the string type.

Looking at the schema, measResults should be a list of measResultType, which itself can either be a float or the string "NIL". xsdgen does not have good support for union types today, so it would just become a string, and then measResults should be a []string in the generated output.

from go-xml.

shmsr avatar shmsr commented on June 12, 2024

Yes, I made the changes in go-xml/xsdgen/builtin.go and go-xml/xsdgen/xsdgen.go and it works. Thanks for your suggestions.

I'm still thinking of ways where I can do it in a better way. If you have some more suggestions, I'd love to hear them.

from go-xml.

droyo avatar droyo commented on June 12, 2024

Sure, if you want to file a PR or point me to your fork I can take a look sometime.

from go-xml.

shmsr avatar shmsr commented on June 12, 2024

Sorry, @droyo that I took a long time to reply back to you. Please refer the commit for the changes.

You can then close this issue. Thanks!

from go-xml.

droyo avatar droyo commented on June 12, 2024

Thanks @shmsr . Looking at your commit, it's very specific to the schema you're using and wouldn't be generically usable. I think the best fit for a generic anySimpleType would be a string rather than a float64. And then sum types like union and enum would have to be implemented on top of that.

I'm glad you figured it out, though!

from go-xml.

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.