<html>
<head>
<title>&lt;xsl:copy-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:copy-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 kopiert etwas in den Ergebnisbaum. Das Attribut <span class="LITERAL">select</span> definiert den zu kopierenden Inhalt. Identifiziert das Attribut <span class="LITERAL">select</span> das Fragment eines Ergebnisbaums, so wird das komplette Fragment in den Ergebnisbaum kopiert. Identifiziert das Attribut <span class="LITERAL">select</span> eine Knotenmenge, werden alle Knoten dieser Knotenmenge in den Ergebnisbaum kopiert, und zwar in der Dokumentreihenfolge. (Im Gegensatz zur Anweisung <span class="LITERAL">&lt;xsl:copy&gt;</span>, mit der der Knoten in seiner Gesamtheit kopiert wird, einschlie&szlig;lich der vorhandenen Namensraumknoten, Attributknoten und untergeordneten Knoten.) Identifiziert das Attribut <span class="LITERAL">select</span> etwas anderes als ein Ergebnisbaumfragment oder eine Knotenmenge, wird es in einen String konvertiert und in den Ergebnisbaum eingef&uuml;gt.</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 enth&auml;lt einen XPath-Ausdruck, der die Knoten definiert, die ins Ausgabedokument kopiert werden sollen.
<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:copy-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:copy-of&gt;</span> erscheint innerhalb einer Vorlage. </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 11.3, Benutzen von Variablen- und Parameterwerten mit <span class="LITERAL">xsl:copy-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>Die Funktionsweise von <span class="LITERAL">&lt;xsl:copy-of&gt;</span> wird anhand eines einfachen Stylesheet veranschaulicht, welches das Eingabedokument in den Ergebnisbaum kopiert. Hier das Stylesheet:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
  &lt;xsl:output method="xml"/&gt;

<!--<?troff .Nd 10?>-->
  &lt;xsl:template match="/"&gt;
    &lt;xsl:copy-of select="."/&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre></span>
<p>Dieses Stylesheet wird mit dem folgenden Dokument getestet:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;list&gt;
  &lt;title&gt;A few of my favorite albums&lt;/title&gt;
  &lt;listitem&gt;A Love Supreme&lt;/listitem&gt;
  &lt;listitem&gt;Beat Crazy&lt;/listitem&gt;
  &lt;listitem&gt;Here Come the Warm Jets&lt;/listitem&gt;
  &lt;listitem&gt;Kind of Blue&lt;/listitem&gt;
  &lt;listitem&gt;London Calling&lt;/listitem&gt;
  &lt;listitem&gt;Remain in Light&lt;/listitem&gt;
  &lt;listitem&gt;The Joshua Tree&lt;/listitem&gt;
  &lt;listitem&gt;The Indestructible Beat of Soweto&lt;/listitem&gt;
&lt;/list&gt;</pre></span>
<p>Wenn das XML-Dokument transformiert wird, sind die Ergebnisse dem Eingabedokument auffallend &auml;hnlich:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;list&gt;
  &lt;title&gt;A few of my favorite albums&lt;/title&gt;
  &lt;listitem&gt;A Love Supreme&lt;/listitem&gt;
  &lt;listitem&gt;Beat Crazy&lt;/listitem&gt;
  &lt;listitem&gt;Here Come the Warm Jets&lt;/listitem&gt;
  &lt;listitem&gt;Kind of Blue&lt;/listitem&gt;
  &lt;listitem&gt;London Calling&lt;/listitem&gt;
  &lt;listitem&gt;Remain in Light&lt;/listitem&gt;
  &lt;listitem&gt;The Joshua Tree&lt;/listitem&gt;
  &lt;listitem&gt;The Indestructible Beat of Soweto&lt;/listitem&gt;
&lt;/list&gt;</pre></span>
<p>Der einzige Unterschied zwischen den beiden Dokumenten besteht darin, dass die Stylesheet-Engine die XML-Deklaration um das Kodierungsattribut <span class="LITERAL">encoding</span> erweitert hat. Vergleichen Sie dies mit dem Beispiel zum Element <span class="LITERAL">&lt;xsl:copy&gt;</span>.</p>
</td>
</tr>
</table>
</div>
</body>
</html>
