<?php
// "Create" the document.
$xml = new DOMDocument( "1.0", "ISO-8859-15" );
//to have indented output, not just a line
$xml->preserveWhiteSpace = false;
$xml->formatOutput = true;
// ------------- Interresting part here ------------
//creating an xslt adding processing line
$xslt = $xml->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="base.xsl"');
//adding it to the xml
$xml->appendChild($xslt);
// ----------- / Interresting part here -------------
//adding some elements
$root = $xml->createElement("list");
$node = $xml->createElement("contact", "John Doe");
$root-> appendChild($node);
$xml-> appendChild($root);
//creating the file
$xml-> save("output.xml");
?>
Warning: DOMDocument::save(): open_basedir restriction in effect. File(output.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/3es0t on line 27
Warning: DOMDocument::save(output.xml): Failed to open stream: Operation not permitted in /in/3es0t on line 27
Output for 8.0.13
Warning: DOMDocument::save(output.xml): Failed to open stream: Read-only file system in /in/3es0t on line 27
Output for 7.3.32 - 7.3.33, 7.4.33
Warning: DOMDocument::save(output.xml): failed to open stream: Read-only file system in /in/3es0t on line 27
Warning: DOMDocument::save(): open_basedir restriction in effect. File(output.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/3es0t on line 27
Warning: DOMDocument::save(output.xml): failed to open stream: Operation not permitted in /in/3es0t on line 27
Warning: DOMDocument::save(output.xml): failed to open stream: Permission denied in /in/3es0t on line 27
Output for 5.0.0 - 5.0.5
Warning: DOMDocument::save(output.xml): failed to open stream: Permission denied in /in/3es0t on line 27
Warning: DOMDocument::save(output.xml): failed to open stream: Permission denied in /in/3es0t on line 27
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/3es0t on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/3es0t on line 4