mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix #74492: XMLWriter adds indent between mixed child nodes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351014 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8d11b029ad
commit
48f89dadf5
1 changed files with 36 additions and 0 deletions
|
@ -48,6 +48,42 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="xmlwriter-set-indent.example.mixed-content">
|
||||
<title><methodname>XMLWriter::setIndent</methodname> and mixed Content</title>
|
||||
<para>
|
||||
Enabling indentation is not suitable for mixed content, because the indent
|
||||
string is also inserted before inline elements.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$writer = new XMLWriter();
|
||||
$writer->openMemory();
|
||||
$writer->setIndent(2);
|
||||
$writer->startDocument();
|
||||
$writer->startElement('p');
|
||||
$writer->text('before');
|
||||
$writer->writeElement('a', 'element');
|
||||
$writer->text('after');
|
||||
$writer->endElement();
|
||||
$writer->endDocument();
|
||||
echo $writer->outputMemory();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<?xml version="1.0"?>
|
||||
<p>before <a>element</a>
|
||||
after</p>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
|
|
Loading…
Reference in a new issue