I'm having difficulty modifying values in an XML file, I have the below code snippet. The XML snippet below is a very cut down version of the XML file, I keep getting this error when I run the code:
Error
Warning: Creating default object from empty value in updateXML.php
PHP
$doc = new DOMDocument();
$doc->load($vNewFile);
$vPayment = $doc->getElementsByTagName("Payment");
foreach ($vPayment AS $vPaymt) {
$vPaymt->Name->nodeValue = self::NAME;
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<Customer>
...
<Payment>
<Name></Name>
...
</Payment>
...
</Customer>
</Document>
Any help with this issue is greatly appreciated as I'm stupid, just can't figure it out.