Coder Social home page Coder Social logo

Comments (3)

edward-ellis avatar edward-ellis commented on July 24, 2024

BuildingSync.zip

from jaxb2ruby.

sshaw avatar sshaw commented on July 24, 2024

[ERROR] Complex type and its child element share the same name "ScenarioType". Use a class customization to resolve this conflict. line 2265 of file:/C:/jaxb/BuildingSync.xsd

This is coming from JAXB (xjc). Two ways to resolve this:

1. Specify a mapping via an JAXB config file

Currently jaxb2ruby does not provide a "friendly" way to do this, nor does it allow one to specify a JAXB config file as it may conflict with the one it uses. So I guess at this time this is just a theoretical option that would make a nice feature πŸ˜ƒ. The latter may be trivial (pull requests welcome!), but testing would be needed to ensure the internal config had priority.

You can see how to do this under the Fix Collides Example section in the JAXB docs.

2. Modify the schema

Change the ScenarioType complex type to something like ScenarioDataType. This will not affect XML to object mapping; it will just result in a class named ScenarioDataType being created instead of one named ScenarioType.

Really you'll probably want to use the -n option to rid yourself of the ugly Ruby namespaces that will be created. You can use a file of mappings too. See how the DDEX library does it.

I see that I can use the –c option to specify a YAML file, but I’m not really sure what to put in the YAML file

This command line option (or file) is for mapping XSD data types to Ruby classes. E.g., xsd:boolen to TrueClass.

from jaxb2ruby.

sshaw avatar sshaw commented on July 24, 2024

Closing.

If you have any suggestions on how to improve the docs for this let me know or open a pull request.

Thanks

from jaxb2ruby.

Related Issues (6)

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.