... $this->open($drawing); $this->startSVG(); $this->adaug(); $this->endSVG(); ... function GetSVGcontent($node) { $st = ""; foreach ($node->childNodes as $cnode){ if ($cnode->nodeType==XML_TEXT_NODE){ $st .= $cnode->textContent; } else if ($cnode->nodeType==XML_ELEMENT_NODE) { $st .= "<" . $cnode->tagName; if ($attribnodes = $cnode->attributes) { $st .= " "; foreach ($attribnodes as $anode){ $st .= $anode->nodeName . "='" . $anode->nodeValue . "' "; } } $nodeText = $this->GetContentAsString($cnode,$obj,$lin); if (empty($nodeText) && !$attribnodes){ $st .= " />"; } else { $st .= ">" . $nodeText . "nodeName . ">"; } } } return $st; } Function open($file){ $this->xdoc = new DOMDocument("1.0","UTF-8"); $this->xdoc->Load($this->drawing); $this->svg = $this->xdoc->getElementsByTagName('svg')->item(0); } Function startSVG(){ /** * $BOM = sprintf('%c%c%c',0xEF,0xBB,0xBF); * echo $BOM.""; */ echo ""; echo ""; echo ""; echo ""; } Function endSVG(){ echo ""; } Function adaug(){ //adaugare element $newgrup = $this->xdoc->createElement("text"); $this->svg->appendChild($newgrup); $newgrup->setAttribute("id","texttest"); $newgrup->setAttribute("x",$this->x-50); $newgrup->setAttribute("y",$this->y); $newgrup->setAttribute("style","font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:'Arial Unicode MS'"); $this->y=$this->y+10; $textvalue = $this->xdoc->createTextNode("11111111111111111111"); $newgrup->appendChild($textvalue); echo $this->GetSVGcontent($newgrup); //$newElement = $this->xdoc->createElement("text"); //$txtNode = $this->xdoc->createTextNode("Project Manager"); //$newElement->appendChild($txtNode); //$this->svg->appendChild($newElement); //$this->showvalue("123321",0,0); } ...