Weave Code
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

Xml Lint Laravel Package

sclable/xml-lint

Command-line tool to lint XML files and validate them against referenced XSD schemas. Works on single files or entire directories (optionally recursive), with verbose output, exclusions, and the ability to skip schema validation. Install via Composer and run vendor/bin/xmllint.

View on GitHub
Deep Wiki
Context7

A php tool to lint and validate xml files from the commandline.

Frequently asked questions about Xml Lint
How do I install Sclable XML Lint in a Laravel project?
Run `composer require sclable/xml-lint` in your Laravel project directory. The package installs as a CLI tool, so you can immediately use `vendor/bin/xmllint` to validate XML files.
Does this package support Laravel 11 or 12?
Yes, Sclable XML Lint is fully compatible with Laravel 11 (PHP 8.2+) and Laravel 12 (PHP 8.4+). It leverages PHP 8.4’s performance improvements for faster validation in high-throughput environments.
Can I validate XML files recursively in a directory?
Yes, use `vendor/bin/xmllint path/to/directory` to validate all XML files recursively. Disable recursion with `-r 0` if needed, or exclude files/folders using `-e pattern`.
How do I skip XSD schema validation?
Add the `-s` flag to `vendor/bin/xmllint` to skip XSD validation and only check XML syntax. This is useful for quick linting without schema dependencies.
Is there a way to integrate this with Laravel’s Artisan commands?
Yes, you can wrap the CLI tool in an Artisan command or middleware. For example, use `shell_exec('vendor/bin/xmllint file.xml')` in a custom command or validate XML in middleware before processing API requests.
What happens if XML validation fails in production?
The tool outputs detailed error messages to stderr by default. For Laravel integration, consider wrapping the CLI output in a custom exception handler to log errors or return API-friendly responses.
Does Sclable XML Lint support custom validation rules beyond XSD?
No, this package focuses on syntax linting and XSD validation. For custom rules, extend the tool by parsing its output or integrate it with a separate validation library like `spatie/xml-to-array`.
How do I test XML validation in a Laravel test suite?
Use PHPUnit to mock the CLI tool or call it via `shell_exec()` in tests. For example, test a custom Artisan command that validates XML files and assert the output matches expected errors.
What are the performance implications for large XML files?
Sclable XML Lint is optimized for CLI use. For large files, enable PHP 8.4’s JIT compiler (`php -d opcache.enable=1`) to reduce validation latency. Test with `php -d opcache.jit_buffer_size=100M` for better throughput.
Are there alternatives to this package for Laravel?
For Laravel-specific XML validation, consider `spatie/xml-to-array` (for parsing) or `sabre/xml` (for advanced schema handling). However, Sclable XML Lint is ideal for CLI-driven workflows like pre-commit hooks or batch processing.
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor