Example #1
0
 /**
  * Modifies the configuration.
  *
  * @param \SimpleXMLElement $xml
  * @return \Geissler\CSL\Date\DatePart
  */
 public function modify(\SimpleXMLElement $xml)
 {
     $this->formatting->modify($xml);
     $this->textCase->modify($xml);
     $this->affix->modify($xml);
     foreach ($xml->attributes() as $name => $value) {
         switch ($name) {
             case 'name':
                 $this->render->modify($xml);
                 break;
             case 'range-delimiter':
                 $this->delimiter = (string) $value;
                 break;
         }
     }
     return $this;
 }
Example #2
0
 /**
  * Modify the first child element.
  *
  * @param string $class full, namespace aware class name
  * @param \SimpleXMLElement $xml
  * @return boolean
  */
 public function modifyChildElement($class, \SimpleXMLElement $xml)
 {
     if ($this->render instanceof $class == true && $this->render instanceof \Geissler\CSL\Interfaces\Modifiable == true) {
         $this->render->modify($xml);
         return true;
     } elseif ($this->render instanceof \Geissler\CSL\Interfaces\Parental == true) {
         if ($this->render->modifyChildElement($class, $xml) == true) {
             return true;
         }
     }
     return false;
 }