|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: 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: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








