src/CFDIReader/SchemasValidator/SchemasValidator.php
public function validateWithRetriever(string $content)
    {
        // obtain the retriever, throw its own exception if non set
        $retriever = $this->getRetriever();
        // create the schema validator object
        $validator = new SchemaValidator($content);
        // obtain the list of schemas
        $schemas = $validator->buildSchemas();
        // replace with the local path
        foreach ($schemas as $schema) {
            /** @var \XmlSchemaValidator\Schema $schema */
            $location = $schema->getLocation();
            $localPath = $retriever->buildPath($location);
            if (! file_exists($localPath)) {
                $retriever->retrieve($location);
            }
            $schemas->create($schema->getNamespace(), $localPath);
        }
        // validate using the modified schemas
        $validator->validateWithSchemas($schemas);
    }
public function validateWithRetriever(string $content)
    {
        // obtain the retriever, throw its own exception if non set
        $retriever = $this->getRetriever();
        // create the schema validator object
        $validator = new SchemaValidator($content);
        // obtain the list of schemas
        $schemas = $validator->buildSchemas();
        // replace with the local path
        foreach ($schemas as $schema) {
            /** @var \XmlSchemaValidator\Schema $schema */
            $location = $schema->getLocation();
            $localPath = $retriever->buildPath($location);
            if (! file_exists($localPath)) {
                $retriever->retrieve($location);
            }
            $schemas->create($schema->getNamespace(), $localPath);
        }
        // validate using the modified schemas
        $validator->validateWithSchemas($schemas);
    }
Validate changing the namespaces locations to local resources and downloading them
if they does not exists

@param string $content
@throws \RuntimeException on validation errors