Thanks Gene - I can get this kind of thing to work in a straight xsl file, but not when I try to compile the xsl file into a java translet using the XSLTC Compiler (documented at http://xml.apache.org/xalan-j/xsltc_usage.html ).
The translet compiler doesn't seem to support the redirect:write extension, but there is a brief mention of the xsltc:output element at http://xml.apache.org/xalan-j/xsltc_constraints.html#xsltcconf . It seems to have been a recent addition and doesn't have namespace info or egs of use. Dave Beaumont Connected Learning Ltd -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 11 March 2002 23:04 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: namespace for xsltc:output ? Dave - I haven't seen an "xsltc:output" element. There is an "xsl:output" element, but it's not just for redirecting output. It does specify the output format, including that of redirected output. Here's what I use. ... xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect" extension-element-prefixes="redirect" ... <xsl:output method="xml" doctype-system="mydocuments.dtd" indent="no"/> ... <redirect:write file="redirected-output.xml"> <xsl:apply-templates select="."/> </redirect:write> ... - Gene Roske Dave Beaumont wrote: > > Hi, > > I'm fairly new to Xalan, having just moved to it from Saxon in order to use > the translet compiler, and am trying to compile an xsl file that uses output > file redirection. The release notes say that redirect:write is not supported > in xsltc, but that "Output can be redirected to a file using the > <xsltc:output> element". > > When I try to compile the trial script below I get the error "Unrecognised > XSLTC extension 'xsltc:output' " which I suspect may be because I'm using a > wrong namespace declaration. I'd be grateful if anyone can help with this. > > ------------------------------ > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0" > xmlns:lxslt="http://xml.apache.org/xslt" > xmlns:xsltc="org.apache.xalan.xsltc.compiler.XSLTC" > extension-element-prefixes="xsltc"> > > <xsl:template match="doc"> > <xsltc:output file="redirect_test.htm"> > <xsl:value-of select="."/> > </xsltc:output> > </xsl:template> > > </xsl:stylesheet> > ------------------------------ > > Thanks, > Dave Beaumont
