/** * @ignore * */ public function load_from_domxml($xml) { $this->xmlroot = $xml; $this->name = DH::findAttribute('name', $xml); if ($this->name === FALSE) { derr("name not found\n"); } if ($this->owner->owner->version >= 60) { $tagRoot = DH::findFirstElement('tag', $this->xmlroot); if ($tagRoot !== false) { $this->tags->load_from_domxml($tagRoot); } $this->membersRoot = DH::findFirstElement('static', $xml); if ($this->membersRoot === false) { $this->isDynamic = true; } else { foreach ($this->membersRoot->childNodes as $node) { if ($node->nodeType != 1) { continue; } $memberName = $node->textContent; if (strlen($memberName) < 1) { derr('found a member with empty name !', $node); } $f = $this->owner->findOrCreate($memberName, $this, true); $this->members[] = $f; } } } else { foreach ($xml->childNodes as $node) { if ($node->nodeType != 1) { continue; } $memberName = $node->textContent; if (strlen($memberName) < 1) { derr('found a member with empty name !', $node); } $f = $this->owner->findOrCreate($memberName, $this, true); $this->members[] = $f; } } }
/** * should only be called from a Rule constructor * @ignore */ public function load_from_domxml($xml) { //print "started to extract '".$this->toString()."' from xml\n"; $this->xmlroot = $xml; $i = 0; foreach ($xml->childNodes as $node) { if ($node->nodeType != 1) { continue; } if ($i == 0 && strtolower($node->textContent) == 'any') { return; } if (strlen($node->textContent) < 1) { derr('this container has members with empty name!', $node); } $f = $this->parentCentralStore->findOrCreate($node->textContent, $this); $this->o[] = $f; $i++; } }