xsl-list
[Top] [All Lists]

Re: Dynamic output method

2005-02-12 14:31:30
Good Answer!  Thanks : )


On Sun, 13 Feb 2005 08:21:26 +1100, Dimitre Novatchev
<dnovatchev(_at_)gmail(_dot_)com> wrote:
Karl,

Even in XSLT 1.0 there's a way to get either
  method="xml"
or
  method="html"

If a value for the "method" attribute is not explicitly specified and
the generated top element by the transformation is with local-name
"html", then the method used for serialisation will be "html",
otherwise it will be "xml"

From the XSLT 1.0 specification (http://w3.org/TR/xslt#output):

"The default for the method attribute is chosen as follows. If

the root node of the result tree has an element child,

the expanded-name of the first element child of the root node (i.e.
the document element) of the result tree has local part html (in any
combination of upper and lower case) and a null namespace URI, and

any text nodes preceding the first element child of the root node of
the result tree contain only whitespace characters,

then the default output method is html; otherwise, the default output
method is xml. The default output method should be used if there are
no xsl:output elements or if none of the xsl:output elements specifies
a value for the method attribute"

Cheers,
Dimitre Novatchev


On Sat, 12 Feb 2005 10:55:22 -0700, Karl Stubsjoen 
<kstubs(_at_)gmail(_dot_)com> wrote:
How abaout with MSXML and Ver. XSL 1.1?


On Sat, 12 Feb 2005 08:52:55 -0000, Michael Kay 
<mike(_at_)saxonica(_dot_)com> wrote:

Is there a way to dynamically set the xsl:output method?  I'd like to
programmitcally set the output for HTML and/or XML.


Many APIs (e.g. JAXP) allow you to set the serialization parameters from 
the
calling application.

In 2.0 you can use xsl:result-document which allows dynamic serialization
parameters.

Michael Kay
http://www.saxonica.com/

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>