<html>
<head>
<title>&lt;xsl:value-of&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:value-of&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 berechnet den Wert eines XPath-Ausdrucks, konvertiert diesen Wert in einen String und schreibt ihn dann in den Ergebnisbaum.</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>Anweisung</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>
select
</dt>
<dd>
Dieses Attribut bezeichnet den XPath-Ausdruck, der ausgewertet und in das Ausgabedokument geschrieben wird.
<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">
<dl>
<dt>
disable-output-escaping
</dt>
<dd>
Dieses Attribut bestimmt, ob Sonderzeichen als Zeichenreferenzen ins Ausgabedokument geschrieben werden. Angenommen, der Literaltext enth&auml;lt das Zeichen <span class="LITERAL">
&gt;
</span>, das normalerweise als <span class="LITERAL">
&amp;
gt;
</span> ins Ausgabedokument geschrieben wird. Wenn Sie <span class="LITERAL">
disable-output-escaping=
"
yes
"
</span> setzen, wird das Zeichen <span class="LITERAL">
&gt;
</span> stattdessen geschrieben. Der XSLT-Prozessor verwendet dieses Attribut nur, wenn Sie die Ausgabemethoden <span class="LITERAL">
html
</span> oder <span class="LITERAL">
xml
</span> verwenden. Wenn Sie <B>&lt; xsl:output method= &quot; text &quot; &gt; </B>verwenden, wird das Attribut ignoriert, da bei der Ausgabemethode <span class="LITERAL">
text
</span> keine Zeichenreferenzierung verwendet wird. In der Beschreibung der Anweisung <xref linkend="text-element">&lt; xsl:text &gt;</xref> finden Sie eine ausf&uuml;hrliche Erl&auml;uterung des Attributs <span class="LITERAL">
disable-output-escaping
</span>.
<P></p>
</dl>
</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:value-of&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:value-of&gt;</span> erscheint innerhalb einer Template.</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 7.6.1, Generierung von Text mit <span class="LITERAL">xsl:value-of</span></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>Das Element <span class="LITERAL">&lt;xsl:value-of&gt;</span> wird dazu verwendet, Text zu generieren. Hier das Stylesheet:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xsl 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:variable name="newline"&gt;
&lt;xsl:text&gt;
&lt;/xsl:text&gt;
  &lt;/xsl:variable&gt;

  &lt;xsl:template match="/"&gt;
    &lt;xsl:text&gt;Your document contains&lt;/xsl:text&gt;
    &lt;xsl:value-of select="count(//*)"/&gt;
    &lt;xsl:text&gt; elements and &lt;/xsl:text&gt;
    &lt;xsl:value-of select="count(//@*)"/&gt;
    &lt;xsl:text&gt; attributes.  &lt;/xsl:text&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;Have a great day!&lt;/xsl:text&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</pre></span>

<p>Als Eingabe dient das folgende XML-Dokument:</p>

<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;report&gt;
  &lt;title&gt;Miles Flown in 2001&lt;/title&gt;
  &lt;month sequence="01"&gt;
    &lt;miles-flown&gt;12379&lt;/miles-flown&gt;
    &lt;miles-earned&gt;35215&lt;/miles-earned&gt;
  &lt;/month&gt;
  &lt;month sequence="02"&gt;
    &lt;miles-flown&gt;32857&lt;/miles-flown&gt;
    &lt;miles-earned&gt;92731&lt;/miles-earned&gt;
  &lt;/month&gt;
  &lt;month sequence="03"&gt;
    &lt;miles-flown&gt;19920&lt;/miles-flown&gt;
    &lt;miles-earned&gt;76725&lt;/miles-earned&gt;
  &lt;/month&gt;
  &lt;month sequence="04"&gt;
    &lt;miles-flown&gt;18903&lt;/miles-flown&gt;
    &lt;miles-earned&gt;31781&lt;/miles-earned&gt;
  &lt;/month&gt;
&lt;/report&gt;</pre></span>

<p>Hier die Ergebnisse:</p>
<span class="PROGRAMLISTING"><pre>
Your document contains 14 elements and 4 attributes.
Have a great day!</pre></span>
</td>
</tr>
</table>
</div>
</body>
</html>
