however the file i now need to edit looks like this
XML File:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<dict>
<key>users</key>
<array>
<dict>
<key>Username</key>
<string>joe</string>
<key>Email</key>
<string>joe@hotmail.com</string>
<key>Password</key>
<string>this-is-joes-password</string>
</dict>
</array>
</dict>
the code i would normally use to edit an xml file would look like this:
Code: Select all
<?php
$xml = new DOMDocument('1.0', 'utf-8');
$xml->formatOutput = true;
$xml->preserveWhiteSpace = false;
$xml->load('file.xml');
$element = $xml->getElementsByTagName('item')->item(0);
$name = $element->getElementsByTagName('name')->item(0);
$name->nodeValue = 'new name';
$element->replaceChild($name, $name);
thanks to anyone who can help!
-Jeff