Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Xsd Reader Laravel Package

goetas/xsd-reader

A PHP library for reading XML Schema (XSD) documents into an object model. It resolves imports and includes and exposes elements, complex and simple types, attributes, restrictions, and annotations, making it easy to inspect schemas programmatically.

Deep Wiki
Context7

goetas/xsd-reader is a PHP library for parsing XML Schema (XSD) documents into a structured PHP object model. It provides a clean API for inspecting schema elements, types, and relationships, making it useful for code generation, validation tooling, and XML-driven applications.

  • Reads XSD 1.0 schemas into navigable PHP objects
  • Supports imports, includes, and schema composition
  • Exposes simple and complex types, elements, attributes, and annotations
  • Designed as a foundation for XSD-to-PHP and other XML tooling
  • Lightweight, extensible, and easy to integrate into existing PHP projects
Frequently asked questions about Xsd Reader
How do I install goetas/xsd-reader in a Laravel project?
Install it with Composer by running composer require goetas/xsd-reader. The library is framework-agnostic, so it does not register a Laravel service provider or facade. You can use its classes directly in controllers, jobs, or service classes, and optionally bind a configured reader instance in a service provider.
Does goetas/xsd-reader work with Laravel 10 and Laravel 11?
Yes, it can be used with Laravel 10 and 11 because it is a plain PHP package with no Laravel-specific dependencies. Actual compatibility depends on the PHP version required by the goetas/xsd-reader release you install, so check its composer.json constraints. Run your test suite on the target Laravel and PHP versions before upgrading.
How do I parse an XSD file into PHP objects with goetas/xsd-reader?
Instantiate the schema reader from the package and pass it your XSD file path or XML string. The reader returns an object model containing elements, types, attributes, and groups. You can then traverse that model to generate code, inspect definitions, or build XML tooling.
What XSD features does goetas/xsd-reader support?
It supports schema imports and includes, simple and complex types, elements, attributes, groups, and annotations. That coverage makes it suitable for reading typical XSD schemas into an object model. For features not covered by your schema, test parsing early and inspect the resulting model.
Can goetas/xsd-reader validate XML documents against an XSD?
The library reads XSD schemas into an object model; it is not primarily an XML instance validator. For validation in Laravel, you can use PHP's DOMDocument::schemaValidate or another validator and use goetas/xsd-reader for schema inspection or code generation. This separation keeps parsing and validation concerns clear.
How do I handle XSD imports and includes with goetas/xsd-reader?
The reader supports XSD imports and includes and resolves referenced schemas as part of parsing. Make sure the schema location paths are reachable from your application and that any custom resolution logic matches your deployment layout. In Laravel, store schemas in a known directory and build absolute paths before reading.
Is goetas/xsd-reader good for XSD-driven code generation?
Yes, its object model is designed for tooling such as XSD-driven code generation and is used by related projects in the goetas ecosystem. You can traverse types and elements to generate PHP classes, DTOs, or configuration. Cache generated output rather than regenerating on every request.
What are alternatives to goetas/xsd-reader for PHP?
Alternatives include other PHP XSD parsing libraries and hand-rolled DOMDocument-based readers tailored to your schema. goetas/xsd-reader is a focused parser with support for imports, includes, types, elements, attributes, groups, and annotations. Choose based on whether you need a full object model, validation, or only lightweight schema inspection.
How should I test code that uses goetas/xsd-reader in Laravel?
Keep small fixture XSD files in your test suite and parse them with the reader to assert the expected object model. Use Laravel's testing helpers for the surrounding application code, but test the reader integration as plain PHP. Include cases for imports, includes, and any schema features your application relies on.
Is goetas/xsd-reader actively maintained and safe for production?
Check the repository's releases, open issues, and recent commits before adopting it, since maintenance activity can change over time. Pin a specific version in composer.json and review the changelog when updating. For production, add tests around the schemas you parse and monitor for PHP version compatibility.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core