Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 6736 invoked from network); 20 Apr 2000 13:39:38 -0000 Received: from mta2.rcsntx.swbell.net (151.164.30.26) by locus.apache.org with SMTP; 20 Apr 2000 13:39:38 -0000 Received: from Ramona ([208.191.166.92]) by mta2.rcsntx.swbell.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with SMTP id <0FTB008AEHY0IV@mta2.rcsntx.swbell.net> for general@xml.apache.org; Thu, 20 Apr 2000 08:39:36 -0500 (CDT) Date: Thu, 20 Apr 2000 08:42:10 -0500 From: Eric Hodges Subject: Re: XSLT output question To: general@xml.apache.org Message-id: <001c01bfaace$3a7cb720$5ca6bfd0@swbell.net> MIME-version: 1.0 X-Mailer: Microsoft Outlook Express 5.00.2919.6600 Content-type: text/plain; charset="iso-8859-1" Content-transfer-encoding: 7bit X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 References: <4.2.0.58.20000420031421.00b32380@inferdata.com> X-Priority: 3 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N ----- Original Message ----- From: "Elaine Brennan" To: Sent: Thursday, April 20, 2000 4:25 AM Subject: Re: XSLT output question > At 07:32 PM 4/19/00 (-0500), Eric Hodges wrote: > > >I'm trying to use the XSLTProcessor.process() method to apply an XSL > >stylesheet to an XML document. Here's the code: > > > > XMLParserLiaisonDefault liaison = new XMLParserLiaisonDefault (); > > XSLTProcessor xsltp = XSLTProcessorFactory.getProcessor(liaison); > > XSLTResultTarget target = new XSLTResultTarget(out); > > xsltp.process(new XSLTInputSource(xml), new XSLTInputSource(xsl), > > target); > >'out' is a Writer. 'xml' and 'xsl' are Documents. > > > >The problem is that the data written to 'out' looks like the XSL input, > >not the result of applying that XSL to the XML. There is one warning: > > > >XSL Warning: xsl:stylesheet requires a 'version' attribute! > > > >but nothing else to indicate failure. Any clues? > > > I'd guess that what you're seeing isn't "output" at all ... that the > processor has reverted to simply showing you the content of your XSL > file. Most likely, when you associated the stylesheet with the document > you forgot to include the version number, like this: > > xmlns:fo="http://www.w3.org/1999/XSL/Format" > version='1.0' > > > The XSLT spec states that the xsl:stylesheet element *must* have a version > attribute on it ... and good XML parsers will do the correct thing when > they notice the missing version number: they'll fail. > > --ELaine I'd hope that a good XSLT processor would throw an exception if it wasn't going to do what I asked it to. Putting the version attribute into my stylesheet causes an error, I think. That was the first thing I tried.