Subject: RE: [xsl] XML Input -> XML OR Text as output From: "Khorasani, Houman" <houman_khorasani@xxxxxxxxxxxxxx> Date: Wed, 5 Oct 2005 11:19:34 +0100 |
Thanks Michael, a) worked for me. Regards Houman -----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: 04 October 2005 19:44 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx 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@xxxxxxxxxxxxxx] > Sent: 04 October 2005 18:22 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XML Input -> XML OR Text , Michael Kay | Thread | [xsl] comparisons between strings h, TGolshan |
RE: [xsl] Summing Time Durations He, Michael Kay | Date | Re: [xsl] Problem in Preceding node, aaron apigo |
Month |