/** * Parses the layout configuration. * * @param \SimpleXMLElement $xml */ public function __construct(\SimpleXMLElement $xml) { $this->delimiter = ""; $this->affix = new Affix($xml); $this->formatting = new Formatting($xml); $this->expand = new ExpandFormatting(); $this->discretionary = new Discretionary(); foreach ($xml->attributes() as $name => $value) { if ($name == 'delimiter') { $this->delimiter = (string) $value; } } $children = new Children(); $this->children = $children->create($xml); }
/** * Parses the If configuration. * * @param \SimpleXMLElement $xml */ public function __construct(\SimpleXMLElement $xml) { $this->children = array(); $match = 'all'; foreach ($xml->attributes() as $name => $value) { if ($name == 'match') { $match = (string) $value; break; } } foreach ($xml->attributes() as $name => $value) { switch ($name) { case 'disambiguate': $this->validation = new Disambiguate(); break; case 'is-numeric': $this->validation = new IsNumeric((string) $value, $match); break; case 'is-uncertain-date': $this->validation = new IsUncertainDate((string) $value, $match); break; case 'locator': $this->validation = new Locator((string) $value, $match); break; case 'position': $this->validation = new Position((string) $value, $match); break; case 'type': $this->validation = new Type((string) $value, $match); break; case 'variable': $this->validation = new Variable((string) $value, $match); break; } } $children = new Children(); $this->children = $children->create($xml); }
/** * Parses the configuration. * * @param \SimpleXMLElement $xml */ public function __construct(\SimpleXMLElement $xml) { $children = new Children(); $this->children = $children->create($xml); }