XML_Beautifier::formatFile() – beautify a file


require_once 'XML/Beautifier.php';

object XML_Beautifier::formatFile ( string $file , string $newFile = null , string $renderer = "Plain" )


Beautifies a file.


  • string $file - filename of the original file

  • string $newFile - filename for the beautified file. If no file is given, the method will return the resulting XML document. To overwrite the original file, pass XML_BEAUTIFIER_OVERWRITE.

  • string $renderer - renderer to use, currently only a "Plain" XML renderer can be used.

Return value

mixed Either true, if file has been written or the XML document string.


This function can not be called statically.

return API version (Previous) beautify a string (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.