5

I see that in the XSL there is an instruction that prints some text to the debug output console.

<xsl:message>
    SOME MESSAGES
</xsl:message>

How can I print the whole document's content to the console?

Nawa
  • 2,058
  • 8
  • 26
  • 48

1 Answers1

7

Try

<xsl:message>
  <xsl:copy-of select="/"/>
</xsl:message>

or simply

<xsl:message select="/"/>

Which XSLT 2.0 procesor do you use?

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
  • Nice... I thought `` could only handle string content. – LarsH Aug 19 '11 at 16:33
  • @Martin: I take it that `` will not print out a node-set? –  May 24 '12 at 09:04
  • `xsl:value-of` creates a text node with the string value(s) of the expression in the `select` attribute so you can use use `` but it simply outputs the string value of the first node in XSLT 1.0 or the string values of all nodes in XSLT 2.0. If you want to output the nodes then use `copy-of` (XSLT 1.0 and 2.0) or `sequence-of` (XSLT 2.0) (or of course as in the above example make use of the `select` attribute of the instruction you use anyway (e.g. `` or ``. – Martin Honnen May 24 '12 at 09:18