Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct ( $xml, \Magento\Framework\Config\ValidationStateInterface $validationState, array $idAttributes=[], $typeAttributeName=null, $schemaFile=null, $errorFormat=self::ERROR_FORMAT_DEFAULT) | |
merge ($xml) | |
getDom () | |
validate ($schemaFileName, &$errors=[]) | |
setSchemaFile ($schemaFile) | |
Static Public Member Functions | |
static | validateDomDocument (\DOMDocument $dom, $schema, $errorFormat=self::ERROR_FORMAT_DEFAULT) |
Data Fields | |
const | ROOT_NAMESPACE_PREFIX = 'x' |
const | ERROR_FORMAT_DEFAULT = "%message%\nLine: %line%\n" |
Protected Member Functions | |
_mergeNode (\DOMElement $node, $parentPath) | |
_isTextNode ($node) | |
_mergeAttributes ($baseNode, $mergeNode) | |
_getNodePathByParent (\DOMElement $node, $parentPath) | |
_getMatchedNode ($nodePath) | |
_initDom ($xml) | |
Protected Attributes | |
$dom | |
$nodeMergingConfig | |
$typeAttributeName | |
$schema | |
$errorFormat | |
$rootNamespace | |
__construct | ( | $xml, | |
\Magento\Framework\Config\ValidationStateInterface | $validationState, | ||
array | $idAttributes = [] , |
||
$typeAttributeName = null , |
|||
$schemaFile = null , |
|||
$errorFormat = self::ERROR_FORMAT_DEFAULT |
|||
) |
Build DOM with initial XML contents and specifying identifier attributes for merging
Format of $idAttributes: array('/xpath/to/some/node' => 'id_attribute_name') The path to ID attribute name should not include any attribute notations or modifiers – only node names
string | $xml | |
\Magento\Framework\Config\ValidationStateInterface | $validationState | |
array | $idAttributes | |
string | $typeAttributeName | |
string | $schemaFile | |
string | $errorFormat |
Definition at line 104 of file Dom.php.
|
protected |
|
protected |
|
protected |
Create DOM document based on $xml parameter
string | $xml |
Definition at line 388 of file Dom.php.
|
protected |
|
protected |
|
protected |
Recursive merging of the \DOMElement into the original document
Algorithm:
\DOMElement | $node | |
string | $parentPath | path to parent node |
Definition at line 167 of file Dom.php.
getDom | ( | ) |
DOM document getter
merge | ( | $xml | ) |
Merge $xml into DOM document
string | $xml |
Definition at line 148 of file Dom.php.
setSchemaFile | ( | $schemaFile | ) |
validate | ( | $schemaFileName, | |
& | $errors = [] |
||
) |
Validate self contents towards to specified schema
string | $schemaFileName | absolute path to schema file |
array | &$errors |
Definition at line 415 of file Dom.php.
|
static |
Validate dom document
\DOMDocument | $dom | |
string | $schema | Absolute schema file path or URN |
string | $errorFormat |
Definition at line 301 of file Dom.php.
const ERROR_FORMAT_DEFAULT = "%message%\nLine: %line%\n" |
const ROOT_NAMESPACE_PREFIX = 'x' |