Giter Site home page Giter Site logo

Comments (9)

eed3si9n avatar eed3si9n commented on August 29, 2024

XML Schema Part 2:

Definition: The simple ur-type definition is a special restriction of the ur-type definition whose name is anySimpleType in the XML Schema namespace. anySimpleType can be considered as the base type of all primitive datatypes. anySimpleType is considered to have an unconstrained lexical space and a value space consisting of the union of the value spaces of all the primitive datatypes and the set of all lists of all members of the value spaces of all the primitive datatypes.

For value space that big, it needs to map to Any.

from scalaxb.

 avatar commented on August 29, 2024

Yeah. sigh. Is that easy to do?

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

Yea, it's not bad since there's code in there for xs:anyType already.

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

The following should at least generate the code.

$ mkdir dmtf
$ cd dmtf
$ wget http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd http://schemas.dmtf.org/wbem/wscim/1/common.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_VirtualSystemSettingData.xsd
$ cd ..
$ scalaxb `find . -name '*.xsd'` --wrap-contents "{http://www.vmware.com/vcloud/v1}EntityType" --wrap-contents "{http://www.vmware.com/vcloud/v1}UserType" -p vcloud

from scalaxb.

 avatar commented on August 29, 2024

Well, yes, but the resulting code doesn't compile. :-)

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

I renamed dmtf/common.xsd to dmtf/dmtf_common.xsd, and the errors were reduced to the following:

[vcloud-api-xsd-1.0]$ scalac *.scala
CIM_ResourceAllocationSettingData.scala:55: error: value any2 is not a member of vcloud.CIM_ResourceAllocationSettingData_TypableSequence3
  lazy val any2 = cim_resourceallocationsettingdata_typablesequence3.any2
                                                                     ^
CIM_VirtualSystemSettingData.scala:53: error: value any2 is not a member of vcloud.CIM_VirtualSystemSettingData_TypableSequence3
  lazy val any2 = cim_virtualsystemsettingdata_typablesequence3.any2
                                                                ^
dsp8023_1.1.0.scala:311: error: value any2 is not a member of vcloud.CIM_VirtualSystemSettingData_TypableSequence3
  lazy val any2 = cim_virtualsystemsettingdata_typablesequence3.any2
                                                                ^
dsp8023_1.1.0.scala:346: error: value any2 is not a member of vcloud.CIM_ResourceAllocationSettingData_TypableSequence3
  lazy val any2 = cim_resourceallocationsettingdata_typablesequence3.any2
                                                                     ^
four errors found

I'll look into them, but I think they are different issue from xs:anySimpleType.

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

I created #35 for any2 issue, and that's fixed. Confirmed that the vcloud generated code compiles.

from scalaxb.

sagarcjoshi avatar sagarcjoshi commented on August 29, 2024

xs:anySimpleType gets converted into scalaxb.DataRecord[Any]. Is it right?
I gets difficult to extract value from this. e.g. In CIM_ResourceAllocationSettingData.xsd the value in ResourceType is simple Int/short value. But I am not able to extract it from DataRecord. The value member of this DataRecord returns an XML, instead of actual value.

DataRecord({http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData}ResourceType,<rasd:ResourceType xmlns:ns12="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns="http://www.vmware.com/vcloud/v1.5">3</rasd:ResourceType>)

Actual XML

<ovf:Item>
...
        <rasd:ResourceType>3</rasd:ResourceType>
...
    </ovf:Item>

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

@sagarcjoshi Could you open a separate issue for the handling of ResourceType, or send an email to the mailing list to discuss this please? The answer is a bit involved, and I don't want to tack on to this case.

from scalaxb.

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.