Hallo Andreas,
<xsl:output cdata-section-elements="pre" />
<pre><xsl:copy-of select="/" /></pre>Ich hatte das nicht getestet
Das hast du in der Tat gesagt.
und mich nur an das gehalten, was im Standard steht:
sorry... *hüstel* <leise>Nicht wirklich.</leise>
- "cdata-section-elements specifies a list of the names of elements whose text node children should be output using CDATA sections"
Beachte: text node children, und mit copy-of hast du nur Element-Kinder im <pre>.
- "The detailed semantics of each attribute will be described separately for each output method for which it is applicable. If the semantics of an attribute are not described for an output method, then it is not applicable to that output method."
For example,
<xsl:output cdata-section-elements="example"/>
would cause a literal result element written in the stylesheet as
<example><foo></example>
Gilt erstens wie gesagt für Textinhalte eines Elements und zweitens nur wenn du method="xml" angibst, was du nicht machtest, womit method="html" angenommen wird. Und für diese ist cdata-section-elements "not applicable" --> siehe 2)
method="xml" würde es zwar "bringen", dann aber kann der IE die Seite nicht anzeigen.
Grüße
Thomas