xsl-list
[Top] [All Lists]

RE: XML Input -> XML OR Text as output

2005-10-05 03:19:34
Thanks Michael,

a) worked for me.

Regards
Houman

-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Sent: 04 October 2005 19:44
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] XML Input -> XML OR Text as output

You've got several choices:

(a) you can import your method="xml" stylesheet from a method="text"
stylesheet; the importing stylesheet will override the importee.

(b) many APIs or command line interfaces allow you to override the
serialization parameters specified within the stylesheet. For example,
in
Saxon, add !method=text to the command line.

(c) in XSLT 2.0 you can generate the output using the
xsl:result-document
instruction. This can compute serialization parameters at run-time (the
attributes are AVTs).

Incidentally, it's conventional to put xsl:output near the start, but it
doesn't have to be, so long as it's a top-level element (a child of
xsl:stylesheet).

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

-----Original Message-----
From: Khorasani, Houman [mailto:houman_khorasani(_at_)csgsystems(_dot_)com] 
Sent: 04 October 2005 18:22
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] XML Input -> XML OR Text as output

Hello everyone,

In few words I have this problem:

I have an XML file as input.  Based on a condition I would like to
produce the output in XML or in TEXT.

However the output tag has to be declared in the beginning of 
the XSLT,
right?

<xsl:output method="xml" version="1.0" encoding="ISO-8859-1"
indent="yes"/>

Or can I set this later within an if-condition?

Many thanks,
Houman

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