<html>
<head>
<title>&lt;xsl:strip-space&gt;</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Beschreibung">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">&lt;xsl:strip-space&gt;</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description">
Diese Anweisung legt fest, aus welchen Elementen des Ausgangsdokuments Leerr&auml;ume entfernt werden sollen.</td></tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Kategorie</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Element der obersten Ebene</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Obligatorische Attribute</td>
</tr>
<tr>
<td colspan="2" class="description">
<dl>
<dt>
elements
</dt>
<dd>
Dieses Attribut enth&auml;lt eine durch Leerzeichen getrennte Liste an Ausgangsdokumentelementen, f&uuml;r die nicht signifikanter Leerraum entfernt werden soll. Mit &quot;nicht signifikantem Leerraum&quot; sind Textknoten gemeint, die nichts als Leerr&auml;ume enthalten. Leerr&auml;ume, die im Text vorkommen oder den Text umschlie&szlig;en, werden erhalten.
<P></p>
</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Optionale Attribute</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Keine</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Inhalt</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Keiner. <span class="LITERAL">&lt;xsl:strip-space&gt;</span> ist ein leeres Element.</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">&Uuml;bergeordnetes Element</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>
<span class="LITERAL">&lt;xsl:strip-space&gt;</span> ist ein Element der obersten Ebene und kann nur dem Element <link linkend="stylesheet-element"><span class="LITERAL">&lt;xsl:stylesheet&gt;</span></link> untergeordnet werden.  </p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Definition</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>XSLT-Abschnitt 3.4, Entfernen von Leerr&auml;umen  </p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Beispiel</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Die Funktionsweise des Elements <span class="LITERAL">&lt;xsl:strip-space&gt;</span> wird durch das folgende Stylesheet veranschaulicht:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;

  &lt;xsl:output method="text"/&gt;
  &lt;xsl:strip-space elements="listing"/&gt;

  &lt;xsl:variable name="newline"&gt;
&lt;xsl:text&gt;
&lt;/xsl:text&gt;
  &lt;/xsl:variable&gt;

  &lt;xsl:template match="/"&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:value-of select="/code-sample/title"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:for-each select="/code-sample/listing"&gt;
      &lt;xsl:value-of select="."/&gt;
    &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre></span>
<p>Dieses Stylesheet wird zur Verarbeitung des folgenden Dokuments verwendet:</p>
      <span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;code-sample&gt;
  &lt;title&gt;Conditional variable initialization&lt;/title&gt;
  &lt;listing&gt;
  &lt;type&gt;int&lt;/type&gt; &lt;variable&gt;y&lt;/variable&gt; = &lt;constant&gt;23&lt;/constant&gt;;
  &lt;type&gt;int&lt;/type&gt; &lt;variable&gt;x&lt;/variable&gt;;
<!--<?troff .Nd 10?>-->
    &lt;keyword&gt;if&lt;/keyword&gt; (&lt;variable&gt;y&lt;/variable&gt; &gt; &lt;constant&gt;10&lt;/constant&gt;)
    &lt;variable&gt;x&lt;/variable&gt; = &lt;constant&gt;5&lt;/constant&gt;;
  &lt;keyword&gt;else&lt;/keyword&gt; 
    &lt;keyword&gt;if&lt;/keyword&gt; (&lt;variable&gt;y&lt;/variable&gt; &gt; &lt;constant&gt;5&lt;/constant&gt;)
      &lt;variable&gt;x&lt;/variable&gt; = &lt;constant&gt;3&lt;/constant&gt;;
  &lt;keyword&gt;else&lt;/keyword&gt;
    &lt;variable&gt;x&lt;/variable&gt; = &lt;constant&gt;1&lt;/constant&gt;;
  &lt;/listing&gt;
&lt;/code-sample&gt;</pre></span>
<p>Hier die Ergebnisse:</p>
<span class="PROGRAMLISTING"><pre>

Conditional variable initialization
inty = 23;
  intx;
    if (y &gt; 10)
    x = 5;
  elseif (y &gt; 5)
      x = 3;
  elsex = 1;</pre></span>
<p>Beachten Sie, dass aus dem Element <span class="LITERAL">&lt;listing&gt;</span> alle zus&auml;tzlichen Leerr&auml;ume entfernt worden sind.  Dazu geh&ouml;ren die Leerzeichen zwischen den verschiedenen Elementen in <span class="LITERAL">&lt;listing&gt;</span>, z.&nbsp;B. <span class="LITERAL">&lt;keyword&gt;</span>, <span class="LITERAL">&lt;constant&gt;</span> und <span class="LITERAL">&lt;variable&gt;</span>.  Vergleichen Sie dieses Beispiel mit dem in der Beschreibung des Elements <link linkend="preserve-space-element"><span class="LITERAL">&lt;preserve-space&gt;</span></link>.</p>
</td>
</tr>
</table>
</div>
</body>
</html>
