Print specific XML node value into form text field

gogo

New Member
I have find out how to replace specific node values with PHP string using PHP DOM, now I need print these XML values into form fields. For replacing I'm using this PHP code, and maybe somehow I can modify this code for printing specific values, because this XML file is very complex \[code\] $file = "../redagavimui/word/document.xml"; $fp = fopen($file, "rb") or die("error"); $str = fread($fp, filesize($file)); $xml = new DOMDocument(); $xml->formatOutput = true; $xml->preserveWhiteSpace = false; $xml->loadXML($str) or die("Error"); $root = $xml->documentElement; $fnode = $root->childNodes->item(0); $ori = $fnode->childNodes->item(1); $ori1 = $ori->childNodes->item(3); $ori2 = $ori1->childNodes->item(1); $ori3 = $ori2->childNodes->item(1); $ori4 = $ori3->childNodes->item(1); $ori5 = $ori4->childNodes->item(1); $wt = $xml->createElement("w:t"); $wtText = $xml->createTextNode("".$name." ".$surname.""); $wt->appendChild($wtText); $ori4->replaceChild($wt,$ori5); $xml->save("../generavimui/word/document.xml");\[/code\]I need to reach same value ($ori5) and print it to form field, but I'm not sure how to do that. Thank you for advices.
 
Back
Top