-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] added ability to create default/fixed value nodes during XSD Schema Validation #13184
[FEATURE] added ability to create default/fixed value nodes during XSD Schema Validation #13184
Conversation
…fault/fixed value nodes during XSD Schema Validation with flag 'LIBXML_SCHEMA_CREATE'
…earch/_files/search_request_merged.php for \Magento\Framework\Search\Request\Config\FileSystemReaderTest::testRead
@matthiasherold thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
To be able to use this feature effectively in production mode the interface The This probably will slow down the caching-process a little (done in |
Hi @slavvka, thank you for the review. |
Hi @matthiasherold, thank you for your contribution! |
…des during XSD Schema Validation #13184
Description
This feature adds the functionality / ability to use defined default values from xsd schemas in xml config nodes.
This was probably not implemented due to backwards-compatibility to PHP 5.4
The constant
LIBXML_SCHEMA_CREATE
was introduced in Libxml >= 2.6.14 (as of PHP >= 5.5.2)As of now magento 2 has a php requirement of
7.0.2|7.0.4|~7.0.6|~7.1.0
and it should be safe to use that extended functionality to harness the full power of XSD-Schemas.Changes applied to
\Magento\Framework\Config\Dom::validateDomDocument
Tests supplied in
\Magento\Framework\Config\Test\Unit\DomTest::testValidateWithDefaultValue
See DOMDocument::schemaValidate
Fixed Issues
XSD schemas can define default values for
xs:attribute
nodes, but the xsd-based schema validation does not merge the defined default values into the merged XML\DomDocument
This behaviour is fixed by calling
\DOMDocument->schemaValidate()
with paramLIBXML_SCHEMA_CREATE