-
Notifications
You must be signed in to change notification settings - Fork 37
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
Unable to generate json schema #88
Comments
You're not getting any output as there's nothing to generate. Your schema does not declare any complex types. Try the following schema: <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
targetNamespace="http://www.w3.org/XML/1998/namespace"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xml:lang="en">
<xs:attribute name="lang">
<xs:simpleType>
<xs:union memberTypes="xs:language">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="space">
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:enumeration value="default"/>
<xs:enumeration value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="base" type="xs:anyURI">
</xs:attribute>
<xs:attribute name="id" type="xs:ID">
</xs:attribute>
<xs:attributeGroup name="specialAttrs">
<xs:attribute ref="xml:base"/>
<xs:attribute ref="xml:lang"/>
<xs:attribute ref="xml:space"/>
<xs:attribute ref="xml:id"/>
</xs:attributeGroup>
<xs:complexType name="test">
<xs:attributeGroup ref="xml:specialAttrs"/>
</xs:complexType>
</xs:schema> You should get |
Thank you sir, much appreciated! I was wondering about that. I am now running into the problem with the xlink.xsd schema below. I will continue debugging. Peter ppiela@ppiela-Inspiron-5577:~/jsonix$ java -jar ./jsonix-schema-compiler-full-2.3.9.jar -generateJsonSchema -d mappings -p xml -logLevel TRACE xlink.xsd [ERROR] The following location is relevant to the above error [ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict. [ERROR] The following location is relevant to the above error [ERROR] org.hisrc.jsonix.execution.JsonixInvoker - The model is null, there was probably a problem parsing schemas. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.w3.org/1999/xlink"> |
On the full schema that I am trying to process I get the following: [WARNING] Simple type "DocumentBase" was not mapped to Enum due to EnumMemberSizeCap limit. Facets count: 600, current limit: 256. You can use customization attribute "typesafeEnumMaxMembers" to extend the limit. |
You'll need to use bindings to customize code generation. See this one for XLink: https://github.com/highsource/w3c-schemas/blob/master/xlink/1999/src/main/resources/xlink-v_1_0.xjb For https://stackoverflow.com/questions/12779046/create-java-classes-with-jaxb If you need support, consider sending me a PR with your schema compilation project here: https://github.com/highsource/jsonix-support Under |
Thank you again for the information! I got through my initial issues, and am now working on the full schema. My eventual goal is to be able to use the json schema with the brutusin:json-forms package to browse, edit, and validate schema instances. The brutusin component will require some enhancement, as it does not provide complete support for the json-schema specification. I will not hesitate to open support cases at the address you provided |
I am brand new to using the schema compiler, and not very familiar with the xml schema notation. I ran the shiporder example, and got the expected results. I am trying to convert a large complex xml schema that uses the building block below.
Running the compiler using the command line below did not generate any files. Any guidance you can provide would be much appreciated.
Thanks. Peter
java -jar ./jsonix-schema-compiler-full-2.3.9.jar -generateJsonSchema -d mappings -logLevel DEBUG xml_test.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
targetNamespace="http://www.w3.org/XML/1998/namespace"
xml:lang="en">
<xs:attribute name="lang">
xs:simpleType
<xs:union memberTypes="xs:language">
xs:simpleType
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="space">
xs:simpleType
<xs:restriction base="xs:NCName">
<xs:enumeration value="default"/>
<xs:enumeration value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="base" type="xs:anyURI">
</xs:attribute>
<xs:attribute name="id" type="xs:ID">
</xs:attribute>
<xs:attributeGroup name="specialAttrs">
<xs:attribute ref="xml:base"/>
<xs:attribute ref="xml:lang"/>
<xs:attribute ref="xml:space"/>
<xs:attribute ref="xml:id"/>
</xs:attributeGroup>
</xs:schema>
The text was updated successfully, but these errors were encountered: