title: Replace <text:s/> with whitespace
body: <p>I try to parse this xml-information: </p>
  
  <pre><code>&lt;text:p &gt;Lorem&lt;text:s/&gt;ipsum.&lt;/text:p&gt;
  </code></pre>
  
  <p>Therefore I'm using XMLReader. Nearly everything is working as I need it. But the &lt;text:s/>-element makes some trouble for me.
  As I want to remove any formatting tags (i.e. bold) I'm using <code>expand()-&gt;textContent</code> to get just the text:</p>
  
  <pre><code>$reader = new XMLReader();
  if (!$reader-&gt;open("content.xml");
  while ($reader-&gt;read()) {
      if ($reader-&gt;nodeType == XMLREADER::ELEMENT &amp;&amp; $reader-&gt;name === 'text:p') echo utf8_decode($reader-&gt;expand()-&gt;textContent);
  }
  </code></pre>
  
  <p>In this case I would get 'Loremipsum.' instead of 'Lorem ipsum.'. How can I replace every &lt;text:s/&gt; with a whitespace.</p>
  
  <p><strong>Update:</strong>
  I did it this way: <code>preg_replace("/&lt;\\/?text:s(\\s+.*?&gt;|&gt;)/", " ", utf8_decode($reader-&gt;readInnerXML()))</code></p>
  
  <p><strong>Update:</strong></p>
  
  <p>If I'm using DOMDocument for parsing, how do I have to change the syntax?</p>
  
  <pre><code>$reader = new DOMDocument();
  $reader-&gt;load("zip://folder/".$file.".odt#content.xml");
  
  while ($reader-&gt;read()){ 
      if ($reader-&gt;nodeType == XMLREADER::ELEMENT &amp;&amp; $reader-&gt;name === 'text:h') { 
          if ($reader-&gt;getAttribute('text:outline-level')=="2") $html .= '&lt;h2&gt;'.$reader-&gt;expand()-&gt;textContent.'&lt;/h2&gt;';
      }
      elseif ($reader-&gt;nodeType == XMLREADER::ELEMENT &amp;&amp; $reader-&gt;name === 'text:p') { 
          if ($reader-&gt;getAttribute('text:style-name')=="Standard") {
              $str = $reader-&gt;readInnerXML(); 
              // replace text:s-elements with " " at this point
          }
      }
  }
  </code></pre>