{"id":18400856,"url":"https://github.com/elomagic/xsd-model","last_synced_at":"2025-10-12T04:39:51.948Z","repository":{"id":75592883,"uuid":"101900937","full_name":"elomagic/xsd-model","owner":"elomagic","description":"Object model of the XSD","archived":false,"fork":false,"pushed_at":"2025-04-09T14:45:29.000Z","size":474,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T15:45:04.847Z","etag":null,"topics":["binding","jarkartaee","java","java17","xsd"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elomagic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-30T15:53:26.000Z","updated_at":"2025-04-09T14:45:31.000Z","dependencies_parsed_at":"2024-06-20T10:25:32.909Z","dependency_job_id":"2639a090-ca92-442c-ba42-f2fc4e62d0ed","html_url":"https://github.com/elomagic/xsd-model","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elomagic%2Fxsd-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elomagic%2Fxsd-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elomagic%2Fxsd-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elomagic%2Fxsd-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elomagic","download_url":"https://codeload.github.com/elomagic/xsd-model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602122,"owners_count":21131612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binding","jarkartaee","java","java17","xsd"],"created_at":"2024-11-06T02:37:05.440Z","updated_at":"2025-10-12T04:39:46.916Z","avatar_url":"https://github.com/elomagic.png","language":"Java","funding_links":["https://www.buymeacoffee.com/elomagic"],"categories":[],"sub_categories":[],"readme":"# xsd-model - Simple object model of the XSD file\n\n---\n\n[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license]\n[![Maven Central](https://img.shields.io/maven-central/v/de.elomagic/xsd-model.svg?label=Maven%20Central)](https://mvnrepository.com/artifact/de.elomagic/xsd-model)\n[![build workflow](https://github.com/elomagic/xsd-model/actions/workflows/maven.yml/badge.svg)](https://github.com/elomagic/xsd-model/actions)\n[![GitHub issues](https://img.shields.io/github/issues-raw/elomagic/xsd-model)](https://github.com/elomagic/xsd-model/issues)\n[![GitHub tag](https://img.shields.io/github/tag/elomagic/xsd-model.svg)](https://GitHub.com/elomagic/xsd-model/tags/)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/elomagic/xsd-model/graphs/commit-activity)\n[![Buymeacoffee](https://badgen.net/badge/icon/buymeacoffee?icon=buymeacoffee\u0026label)](https://www.buymeacoffee.com/elomagic)\n\n## What is this xsd-model ? ###\n\nThis project is a Java library to ease up the reading of XSD files.\n\n* Supports Java 17 or higher\n* Supports Jakarta XML Binding 4.0\n\n## Using the library\n\n### Maven\n\nAdd following dependency to your project. Replace the value of the attribute ```version``` according to the used\nversion in your project.\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd\"\u003e\n\n    ...\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ede.elomagic\u003c/groupId\u003e\n            \u003cartifactId\u003exsd-model\u003c/artifactId\u003e\n            \u003cversion\u003e[3,]\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n    \n    ...\n    \n\u003c/project\u003e\n```\n\n## Using the API\n\n### Read a XSD file\n\n```java\nimport de.elomagic.xsdmodel.XsdReader;\nimport de.elomagic.xsdmodel.elements.XsdSchema;\n\nimport java.nio.file.Paths;\n\nclass Sample {\n\n  void example() throws Exception {\n    System.setProperty(XsdSchemaFactory.XSD_SCHEMA_FACTORY_CLASS, XsdSchemaFactoryMock.class.getName());\n\n    XsdSchema schema = XsdReader.read(Paths.get(\"root2.xsd\"));\n\n    Assertions.assertEquals(\"Documentation of the schema annotation.\", schema.getAnnotation().getDocumentation().getValue());\n    Assertions.assertEquals(12, schema.getComplexTypes().size());\n  }\n  \n}\n```\n\n### Convert XSD to key map\n\nVery experimental implementation of mapping a XSD to key a map.\n\n```java\nimport de.elomagic.xsdmodel.XsdReader;\nimport de.elomagic.xsdmodel.converter.Xsd2KeyValueConverter;\n\nimport java.nio.file.Paths;\n\nclass Sample {\n\n    void example() throws Exception {\n        Xsd2KeyValueConverter\u003cKeyProperties\u003e converter = new Xsd2KeyValueConverter\u003c\u003e()\n                .setKeyDelimiter(\".\")\n                .setAttributeDelimiter(\"#\")\n                .setAttributeSupport(true)\n                .setKeyPropertySupplier(KeyProperties::new);\n\n        Map\u003cString, KeyProperties\u003e map = converter.convert(getClass().getResourceAsStream(\"/example.xsd\"));\n        map.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(e -\u003e System.out.println(e.getKey() + \"=\" + e.getValue().getDatatype()));\n    }\n    \n}\n```\n\n#### Limitations\n\n* No repetition support\n* No attribution support\n* No recursive element type support\n* Simple restriction support\n\n## How to build artefact by myself?\n\nWhat you need is an installed JDK at least version 17 and [Apache Maven](https://maven.apache.org).\nThen clone this project to your local file system and execute `mvn clean install` in the project folder. After successful finish you find\nthe artefact in the `target` folder.\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Versioning\n\nVersioning follows the semantic of [Semantic Versioning 2.0.0](https://semver.org/)\n\n### Releasing new version / hotfix (Only for users who have repository permissions)\n\n#### Releasing new version / hotfix\n\nExecute following steps:\n\n* Are the [CHANGELOG.md](https://github.com/elomagic/xsd-model/blob/main/CHANGELOG.md) up to date?\n* Check the version in the ```pom.xml``` and [CHANGELOG.md](https://github.com/elomagic/xsd-model/blob/main/CHANGELOG.md)\n* Set release date in the [CHANGELOG.md](https://github.com/elomagic/xsd-model/blob/main/CHANGELOG.md)\n* Execute GitHub action \"release\"\n\n## Who do I talk to? ###\n\n* Repo owner or admin\n\n## License\n\nThe xsd-model is distributed under [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n[license]: https://www.apache.org/licenses/LICENSE-2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felomagic%2Fxsd-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felomagic%2Fxsd-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felomagic%2Fxsd-model/lists"}