sandcore-dev / xml-analyzer
Analyze XML files to guess the range of values of attributes and text nodes
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/sandcore-dev/xml-analyzer
Requires
- php: ^7.3
- ext-dom: *
- brick/math: ^0.9.2
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-11-23 07:45:52 UTC
README
Analyze one or more XML strings or files to guess the type and thus the range of values of attributes and node values.
Examples
$analyzer = new \SandcoreDev\XmlAnalyzer\XmlAnalyzer(); // Analyze one or more XML strings. More data is more accurate. $result = $analyzer->process($xmlString, $anotherXmlString, ...$moreXmlStrings); // Analyze one or more XML files. More data is more accurate. $result = $analyzer->processFile($xmlFile, $anotherXmlFile, ...$moreXmlFiles); // Available types are in src/Types/ $result->getType(); $result->getAttributes(); $result->getAttribute('foo'); $result->getChildren(); $child = $result->getChild('bar'); // Each (child) node has the same methods available $child->getType(); $child->getAttributes(); $child->getChildren();