greenter/ubl-validator
Validate UBL (OASIS Universal Business Language) XML documents against official XSD schemas. Automatically resolves the UBL version, locates the matching schema, and reports validation errors. Supports custom XSD directories for other UBL versions.
greenter/ubl-validator is a PHP library for validating XML documents against OASIS Universal Business Language (UBL) schemas. It reads the <cbc:UBLVersionID> from your document, locates the matching XSD file, and runs schemaValidate to confirm the XML is well-formed and compliant—ideal for SUNAT electronic invoicing in Peru.
use Greenter\Ubl\UblValidator;
$validator = new UblValidator();
echo $validator->isValid($xml) ? 'Success!!!' : $validator->getError();
UBLVersionIDisValid() API with readable error messagesUblPathResolverHow can I help you explore Laravel packages today?