xsl-list
[Top] [All Lists]

Re: [xsl] result-document output method vs unnammed output method

2011-11-25 11:06:13
At 2011-11-25 17:02 +0000, Andrew Welch wrote:
Friday afternoon test - try and guess the output:

A.xslt:

<xsl:stylesheet  version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

    <xsl:import href="B.xslt"/>

    <xsl:template match="/" name="main">
        <xsl:result-document method="xml">
            <foo>bar</foo>
        </xsl:result-document>
    </xsl:template>

</xsl:stylesheet>

B.xslt:

<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

    <xsl:output method="text"/>

</xsl:stylesheet>

Well, I've already made one big mistake today ... I'll risk another.  I'll say:

   <foo>bar</foo>

The imported method would have changed the main output to text except that the result-document instruction overrides that.

Why do you ask?

. . . . . . . . . . Ken


--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour video lecture: XSLT/XPath 1.0 & 2.0 http://ude.my/t37DVX
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--