2004-05-09 15:07:48 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2005-02-14 04:13:17 +00:00
|
|
|
<!-- $Revision: 1.3 $ -->
|
2004-12-20 15:57:49 +00:00
|
|
|
<refentry id="function.dom-domdocument-savehtml">
|
|
|
|
<refnamediv>
|
2004-12-21 00:42:35 +00:00
|
|
|
<refname>DOMDocument->saveHTML()</refname>
|
2004-12-20 15:57:49 +00:00
|
|
|
<refpurpose>
|
|
|
|
Dumps the internal document into a string using HTML formatting
|
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<classsynopsis>
|
|
|
|
<ooclass><classname>DOMDocument</classname></ooclass>
|
|
|
|
<methodsynopsis>
|
2005-01-17 08:41:34 +00:00
|
|
|
<type>string</type><methodname>saveHTML</methodname>
|
2004-12-20 15:57:49 +00:00
|
|
|
<void/>
|
|
|
|
</methodsynopsis>
|
|
|
|
</classsynopsis>
|
|
|
|
<para>
|
|
|
|
Creates an HTML document from the DOM representation. This function is usually
|
|
|
|
called after building a new dom document from scratch as in the example below.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
2005-02-14 04:13:17 +00:00
|
|
|
Returns the HTML, or &false; if an error occurred.
|
2004-12-20 15:57:49 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Saving a HTML tree into a string</title>
|
|
|
|
<programlisting role="php">
|
2004-05-09 15:07:48 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-12-20 15:57:49 +00:00
|
|
|
|
|
|
|
$doc = new DOMDocument('1.0');
|
|
|
|
// we want a nice output
|
|
|
|
$doc->formatOutput = true;
|
|
|
|
|
|
|
|
$root = $doc->createElement('html');
|
2004-05-09 15:07:48 +00:00
|
|
|
$root = $doc->appendChild($root);
|
2004-12-20 15:57:49 +00:00
|
|
|
|
|
|
|
$head = $doc->createElement('head');
|
2004-05-09 15:07:48 +00:00
|
|
|
$head = $root->appendChild($head);
|
2004-12-20 15:57:49 +00:00
|
|
|
|
|
|
|
$title = $doc->createElement('title');
|
2004-05-09 15:07:48 +00:00
|
|
|
$title = $head->appendChild($title);
|
2004-12-20 15:57:49 +00:00
|
|
|
|
|
|
|
$text = $doc->createTextNode('This is the title');
|
2004-05-09 15:07:48 +00:00
|
|
|
$text = $title->appendChild($text);
|
2004-12-20 15:57:49 +00:00
|
|
|
|
2004-05-09 15:07:48 +00:00
|
|
|
echo $doc->saveHTML();
|
2004-12-20 15:57:49 +00:00
|
|
|
|
2004-05-09 15:07:48 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2004-12-20 15:57:49 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
2004-12-21 00:42:35 +00:00
|
|
|
<member><xref linkend="function.dom-domdocument-savehtmlfile" /></member>
|
|
|
|
<member><xref linkend="function.dom-domdocument-loadhtml" /></member>
|
|
|
|
<member><xref linkend="function.dom-domdocument-loadhtmlfile" /></member>
|
2004-12-20 15:57:49 +00:00
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2004-05-09 15:07:48 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|