Ejemplo n.º 1
0
 public function verifyElementId($element, $createIfEmpty = false)
 {
     $id = $element->idAttribute;
     if (strlen($id) > 0 && substr($id, 0, 3) != 'pxe') {
         $id = 'pxe-' . $id;
     } elseif (!strlen($id) && $createIfEmpty) {
         if (IdmlPxeHelper::hasPxeHash($element)) {
             $id = "pxe-" . IdmlPxeHelper::getPxeHash($element);
         } else {
             $id = "pxe-" . IdmlPxeHelper::getNewTagHash();
         }
     }
     $element->idAttribute = $id;
 }
Ejemplo n.º 2
0
 public function visitTableCell(IdmlTableCell $element, $depth = 0)
 {
     $this->verifyParentStructure();
     $this->stashParentCount($element);
     $hashTag = null;
     if (!strlen($element->idmlTag)) {
         if ($this->findFirstParent(array("thead", "tbody", "tfoot")) == "thead") {
             $element->idmlTag = "th";
         } else {
             $element->idmlTag = "td";
         }
     }
     if (!IdmlPxeHelper::hasHashValue($element) && $this->pxeRules->isPxeTag($element->idmlTag)) {
         $hashTag = IdmlPxeHelper::getNewTagHash();
     } elseif (IdmlPxeHelper::hasHashValue($element)) {
         $parts = explode('#', $element->idmlTag);
         $element->idmlTag = $parts[0];
         $hashTag = $parts[1];
     }
     $this->pushParentTag($element->idmlTag, $hashTag, $element);
     $parents = implode(' ', array_slice($this->parentStack, 0, count($this->parentStack) - 1));
     $this->setPxeAttributes($element, $element->idmlTag, $parents, $hashTag);
 }