Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include fmi2Unit.xsd #524

Merged
merged 3 commits into from
Feb 11, 2020
Merged

Include fmi2Unit.xsd #524

merged 3 commits into from
Feb 11, 2020

Conversation

ljamt
Copy link
Member

@ljamt ljamt commented Feb 6, 2020

  • Added fmi2Unit.xsd from FMI 2.0 and included it in OspModelDescription.xsd
  • Suggested how units can be applied to variables, examplified in CraneController_OspModelDescription.xml

Closes #523

@mrindar
Copy link
Contributor

mrindar commented Feb 6, 2020

Looks good :)

Copy link
Member

@eidekrist eidekrist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mrindar
Copy link
Contributor

mrindar commented Feb 10, 2020

There is some namespace issues between fmi2Unit.xsd and OspModelDescription.xsd when trying to use jaxb to generate java classes from this schema:

$ xjc OspModelDescription.xsd 

parsing a schema... 

[ERROR] src-resolve.4.1: Error resolving component 'fmi2Unit'. It was detected that 'fmi2Unit'

has no namespace, but components with no target namespace are not referenceable from

schema document 'file:/C:/Users/mar tinr/dev/git/msmi-validator/osp-model-description

/src/main/resources/OspModelDescription.xsd'. If 'fmi2Unit' is intended to have a namespace,

perhaps a prefix needs to be provided. If it is intended that 'fmi2Unit'  has no namespace, then 

an 'import' without a "namespace" attribute should be added to 'file:/C:/Users/martinr/dev/git

/msmi-validator/osp-model-description/src/main/resources/OspModelDescription.xsd'. 

line 12 of file:/C:/Users/martinr/dev/git/msmi-validator/osp-model-description/src/main

/resources/OspModelDescription.xsd 

[ERROR] src-resolve: Cannot resolve the name 'fmi2Unit' to a(n) 'type definition' component.                                                                                                                              

line 12 of file:/C:/Users/martinr/dev/git/msmi-validator/osp-model-description/src/main

/resources/OspModelDescription.xsd

Failed to parse a schema.

@mrindar mrindar self-requested a review February 10, 2020 07:45
@ljamt
Copy link
Member Author

ljamt commented Feb 10, 2020

Ok. There are two ways to have "transitive" xsds: import and include. I did it the same way as fmi2ModelDescription.xsd includes fmi2Unit.xsd. Not at xsd/xml expert so difficult to figure out without having failing code. Are you debugging @mrindar ?

@mrindar
Copy link
Contributor

mrindar commented Feb 10, 2020

Ok. There are two ways to have "transitive" xsds: import and include. I did it the same way as fmi2ModelDescription.xsd includes fmi2Unit.xsd. Not at xsd/xml expert so difficult to figure out without having failing code. Are you debugging @mrindar ?

If you have java installed I think you can just run the following command to reproduce the error:
$ xjc OspModelDescription.xsd

@ljamt
Copy link
Member Author

ljamt commented Feb 10, 2020

If you have java installed I think you can just run the following command to reproduce the error:
$ xjc OspModelDescription.xsd

Looks like adding the osp namespace fixed it.

@ljamt ljamt merged commit 4d78a1f into master Feb 11, 2020
@ljamt ljamt deleted the feature/523-units-in-ospmodeldescr branch February 11, 2020 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include FMI 2.0 unit xsd in OspModelDescription.xml
5 participants