xsd-gen | Java cli tool for generating XSD from an XML | Parser library
kandi X-RAY | xsd-gen Summary
kandi X-RAY | xsd-gen Summary
Command-line tool written in Java for generating XSD from an XML. Can also be used as a library within your application.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Main entry point
- Recurse through the XSD
- Get XML document from input stream
- Get the type of a given content
- Process the attributes
- Write the document to an output stream
- Parses an XML document from an input stream
- Adds the occurences
- Set the XSD prefix
- Compares this object to another
- Creates a hashCode of this object
- Returns a String representation of the document
xsd-gen Key Features
xsd-gen Examples and Code Snippets
Community Discussions
Trending Discussions on xsd-gen
QUESTION
I am currently migrating a project from Java 8 to Java 11. The version change broke our XSD generation.
We are using the org.codehaus.mojo:jaxb2-maven-plugin:2.5.0 to generate the XSD from JAXB annotated classes. But it seems to be ignoring the namespace defined for the different packages, as it prints the following error:
...ANSWER
Answered 2021-Oct-20 at 08:48Turns out the jaxb2-maven-plugin does not support the jakarta.xml.bind imports in its latest form.
So you can either downgrade to a dependency that still has the javax.xml.bind imports or you can switch to a forked version of the plugin that supports the new jaxb-API.
Forked Plugin Repo: https://github.com/evolvedbinary/mojohaus-jaxb-maven-plugin/
QUESTION
I have TCX exercise files which are written using the schema at https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd. I have been using them for years with Java and JAXB. I am trying to write a C# application to do the same thing. It is not going well. I can generate C# classes using xsd.exe as provided by Visual Studio. However, they do not make sense to me and cannot be used to deserialize my TCX files.
The basic structure of TCX files (at least the part in which I am interested) is they have a number of Activities containing a number of Laps containing a number of Tracks containing a number of Trackpoints. The Trackpoints have latitude, longitude, and heart rate as the main items of interest.
The xsd-generated C# classes have an Activity_t[], an ActivityLap_t[], and a Trackpoint_t[][]. There is no Track_t[] and the string Track_t does not appear in the file even though it is in the .xsd, for example in this excerpt for the Lap and Track.
...ANSWER
Answered 2020-Mar-11 at 22:22This appears to be a bug with the xsd.exe
tool itself. I would recommend using LinqToXsd (requires .NET Core 2.1), which is another Microsoft-developed technology for accessing XML data using an XSD; it's also more advanced than xsd.exe
and in my quick testing appears to fully handle the above Garmin training center database schema without issue.
Also if you cannot install .NET Core on your machine, you can use this nuget package instead. The .NET Core version requires .NET Core 2.1 to actually generate code, but that generated code that can be used in an app that targets .NET Framework 4.6.2 and above.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xsd-gen
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page