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

0.2.1 2021-02-16 21:23 UTC

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();