Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 43857 invoked from network); 19 Mar 2000 00:57:06 -0000 Received: from pop.systemy.it (194.20.140.28) by locus.apache.org with SMTP; 19 Mar 2000 00:57:06 -0000 Received: from apache.org (pv47-pri.systemy.it [194.21.255.47]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id BAA00131 for ; Sun, 19 Mar 2000 01:57:02 +0100 Message-ID: <38D41318.7CF520BA@apache.org> Date: Sun, 19 Mar 2000 00:36:56 +0100 From: Stefano Mazzocchi Organization: Apache Software Foundation X-Mailer: Mozilla 4.72 [en] (Win98; I) X-Accept-Language: it,en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: change the !DOCUMENT type/mime type References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Scott_Boag@lotus.com wrote: > > You shouldn't normally get the DOCTYPE decl unless you specify it via > xsl:output doctype-public & doctype-system in normal xsl processing. > However... > > ...I see in the Cocoon code, in HTMLFormatter.java, they are doing: > > public void format(Document document, Writer writer, Dictionary p) > throws Exception { > OutputFormat format = super.getFormat(p); > format.setMethod(Method.HTML); > format.setOmitXMLDeclaration(true); > format.setPreserveSpace(true); > format.setDoctype("-//W3C//DTD HTML 4.0//EN", > "http://www.w3.org/TR/REC-html40/strict.dtd"); > format.setVersion("4.0"); > Serializer serializer = factory.makeSerializer(writer, format); > serializer.asDOMSerializer().serialize(document); > } > > In Cocoon 1.7.x the xsl:output information is not being passed to the > formatter, so you can't really control this. Perhaps someone on the Cocoon > list could give you some suggestions? > > BTW, Cocoon people, you can get the proper OutputFormat object from Xalan's > StylesheetRoot by calling it's getOutputFormat() method. In > XalanTransformer.java you could supply: > > /** > * Get the output properties for the given stylesheet. > */ > OutputFormat getOutputFormat(Document sheet, String sheetBase) > { > XSLTInputSource s = new XSLTInputSource(sheet); > s.setSystemId(sheetBase); > StylesheetRoot stylesheet = processor.processStylesheet(s); > outputFormat = stylesheet.getOutputFormat(); > return stylesheet.getOutputFormat(); > } > > Which would be kind of slow since you don't have a stylesheet pool, but > then you need to get the information from the transformer to the formatter. > This is probably a moot point for Cocoon 1.7.x since I don't think Stefano > wants to be adding features, but Pier should probably take note, if he > doesn't do this already. We may or may not add support for xsl:output... but if present, the XSLT processor cannot be considered a filter anymore, but a serializer. So, we'll have both the XSLTFilter and XSLTSerializer. Why? think about it: you can't futher process your pipeline after you output text out of xslt transformations, don't you think? Anyway, I see no problems in the Cocoon2 architecture for adding it. > > also can i explicitly > > specify the mime type as well? > > Again, you can from XSLT, but the information won't get to the > Formatter/Serializer. > > Someone from the Cocoon list should be better able to help you accomplish > what you need to do. I don't think this is an XSLT/Xalan issue. No, it's not. We currently don't have a way to match xsl:output capabilities because of architectural problems. For now, you can patch the cocoon formatters to achieve what you want to do (the code is _very_ easy). Look, we know this is a problem and we already have solutions... just wait more time for them to stabilize. -- Stefano Mazzocchi One must still have chaos in oneself to be able to give birth to a dancing star. Friedrich Nietzsche -------------------------------------------------------------------- Missed us in Orlando? Make it up with ApacheCON Europe in London! ------------------------- http://ApacheCon.Com ---------------------