Uncaught exception "DOMException" with message "Not Found Error" XPATH

Uncaught exception "DOMException" with message "Not Found Error" XPATH

am 07.11.2007 22:01:29 von marcin.a.zajkowski

Hello,

Below is an example of an XML and PHP file I'm developing, I'm trying
to insertBefore into the XML file butI continue to get this error:

Fatal error: Uncaught exception 'DOMException' with message 'Not Found
Error' in /home/.boots/rddesign/forttryon.com/availabilities/
editor_adjustment.php:100

All help is appreciated!








000000
000000
000000
000000
000000


4489 5G
400
$182,500.00
Available
Studio-J





000000
000000
000000
000000
000000


257 6D
575
$299,125.00
Contract Signed
1BR-H





000000
000000
000000
000000
000000


259 7D
900
$303,500.00
Available
2BR-I.






XML>


$dom = new DomDocument();
$dom->load("testData.xml");
$dom->preserveWhitespace = true;

$xpath = new DomXPath($dom);

//$availabilities = $xpath->query("/availabilities/
unit[@type='Studios']/availability")->item(0);
$availabilities = $xpath->query("/availabilities/
unit[@type='Studios']/availability/name")->item(0);
$availability = $dom->createElement('availability','helloWorld');

$dom->insertBefore($availability, $availabilities);
$dom->save("testData.xml");

?>