protected function addExternalSchemaDocuments(array $schemaDocuments)
    {
        $fs = new Filesystem();

        $externalSchemaDocuments = [];

        foreach ($schemaDocuments as $schemaDocument) {
            /** @var \DOMElement $externalSchemaElement */
            foreach ($schemaDocument->getElementsByTagName('external-schema') as $externalSchemaElement) {
                if (!$externalSchemaElement->hasAttribute('filename')) {
                    continue;
                }

                $externalSchemaPath = $externalSchemaElement->getAttribute('filename');

                if (!$fs->exists($externalSchemaPath)) {
                    continue;
                }

                $externalSchemaDocument = new \DOMDocument();
                if (!$externalSchemaDocument->load($externalSchemaPath)) {
                    continue;
                }

                $externalSchemaDocuments[] = $externalSchemaDocument;
            }
        }

        return $this->mergeDOMDocumentsArrays([$schemaDocuments, $externalSchemaDocuments]);
    }
protected function addExternalSchemaDocuments(array $schemaDocuments)
    {
        $fs = new Filesystem();

        $externalSchemaDocuments = [];

        foreach ($schemaDocuments as $schemaDocument) {
            /** @var \DOMElement $externalSchemaElement */
            foreach ($schemaDocument->getElementsByTagName('external-schema') as $externalSchemaElement) {
                if (!$externalSchemaElement->hasAttribute('filename')) {
                    continue;
                }

                $externalSchemaPath = $externalSchemaElement->getAttribute('filename');

                if (!$fs->exists($externalSchemaPath)) {
                    continue;
                }

                $externalSchemaDocument = new \DOMDocument();
                if (!$externalSchemaDocument->load($externalSchemaPath)) {
                    continue;
                }

                $externalSchemaDocuments[] = $externalSchemaDocument;
            }
        }

        return $this->mergeDOMDocumentsArrays([$schemaDocuments, $externalSchemaDocuments]);
    }
protected function addExternalSchemaDocuments ( array $ schemaDocuments ) { $ fs = new Filesystem ( ) ; $ externalSchemaDocuments = [ ] ; foreach ( $ schemaDocuments as $ schemaDocument ) { /** @var \DOMElement $externalSchemaElement */ foreach ( $ schemaDocument -> getElementsByTagName ( 'external-schema' ) as $ externalSchemaElement ) { if ( ! $ externalSchemaElement -> hasAttribute ( 'filename' ) ) { continue ; } $ externalSchemaPath = $ externalSchemaElement -> getAttribute ( 'filename' ) ; if ( ! $ fs -> exists ( $ externalSchemaPath ) ) { continue ; } $ externalSchemaDocument = new \ DOMDocument ( ) ; if ( ! $ externalSchemaDocument -> load ( $ externalSchemaPath ) ) { continue ; } $ externalSchemaDocuments [ ] = $ externalSchemaDocument ; } } return $ this -> mergeDOMDocumentsArrays ( [ $ schemaDocuments , $ externalSchemaDocuments ] ) ; }
Add external schema documents not already included.
@param \DOMDocument[] $schemaDocuments Schema documents.
@return \DOMDocument[] Schema documents.
Add external schema documents not already included .