<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.dom-htmldocument.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'dom-htmldocument.savexmlfile.php',
    1 => 'Dom\\HTMLDocument::saveXmlFile',
    2 => 'Serializes the document as an XML file',
  ),
  'up' => 
  array (
    0 => 'class.dom-htmldocument.php',
    1 => 'Dom\\HTMLDocument',
  ),
  'prev' => 
  array (
    0 => 'dom-htmldocument.savexml.php',
    1 => 'Dom\\HTMLDocument::saveXml',
  ),
  'next' => 
  array (
    0 => 'class.dom-htmlelement.php',
    1 => 'Dom\\HTMLElement',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/dom/htmldocument/savexmlfile.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="dom-htmldocument.savexmlfile" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Dom\HTMLDocument::saveXmlFile</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">Dom\HTMLDocument::saveXmlFile</span> &mdash; <span class="dc-title">Serializes the document as an <abbr title="eXtensible Markup Language">XML</abbr> file</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-dom-htmldocument.savexmlfile-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Dom\HTMLDocument::saveXmlFile</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$options</code><span class="initializer"> = 0</span></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Serializes the document as an <abbr title="eXtensible Markup Language">XML</abbr> file.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-dom-htmldocument.savexmlfile-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">filename</code></dt>
    <dd>
     <span class="simpara">
      The path to the file to save to.
     </span>
    </dd>
   
   
    <dt><code class="parameter">options</code></dt>
    <dd>
     <span class="simpara">
 Additional Options.
 The <strong><code><a href="libxml.constants.php#constant.libxml-noemptytag">LIBXML_NOEMPTYTAG</a></code></strong>
 and <strong><code><a href="libxml.constants.php#constant.libxml-noxmldecl">LIBXML_NOXMLDECL</a></code></strong> options are supported.
 Prior to PHP 8.3.0, only the <strong><code><a href="libxml.constants.php#constant.libxml-noemptytag">LIBXML_NOEMPTYTAG</a></code></strong>
 option is supported.
</span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-dom-htmldocument.savexmlfile-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   The number of bytes written on success, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-dom-htmldocument.savexmlfile-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     Throws a <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span> if
     <code class="parameter">filename</code> is an empty string or contains any
     null bytes.
    </span>
   </li>
  </ul>
 </div>


 <div class="refsect1 seealso" id="refsect1-dom-htmldocument.savexmlfile-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="dom-htmldocument.savexml.php" class="methodname" rel="rdfs-seeAlso">Dom\HTMLDocument::saveXml()</a> - Serializes the document as an XML string</span></li>
   <li><span class="methodname"><a href="dom-htmldocument.savehtmlfile.php" class="methodname" rel="rdfs-seeAlso">Dom\HTMLDocument::saveHtmlFile()</a> - Serializes the document as an HTML file</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>