Re: [Xsltforms-support] applying a stylesheet in an instance to data in an instance
Brought to you by:
alain-couthures
From: C. M. Sperberg-M. <cm...@bl...> - 2012-07-14 02:32:15
|
[Those not interested in interim or partial results relating to the problem of running XSLT in a form can skip this message and wait for a post mortem analysis later on, once the problem is finally resolved.] On Jul 12, 2012, at 3:15 PM, C. M. Sperberg-McQueen wrote: > In a form I'm working on, I'd like to apply a stylesheet located in a > document instance (instance('filter') to an input document located in > another instance (instance('userdoc')). > > It doesn't seem to be working, and I wonder if anyone here can see > what I'm doing wrong. > > ... > > The form loads as expected and the function seems to be called > without incident and without error messages (and alert messages > confirm that the arguments look pretty much as I expect them to look). > But the result is consistently not the output I expect from the stylesheet, > but a document which reads in its entirety: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> > <head><title></title></head> > <body> > <pre></pre> > </body> > </html> Further data: This is what the output looks like in Safari and Chrome, but in Firefox I get instead something like: <?xml version="1.0" encoding="UTF-8"?> <transformiix:result xmlns:transformiix="http://www.mozilla.org/TransforMiix"></transformiix:result> More generally, all the browsers I've tested appear to force the output of any XSLT transformation to XML (or HTML); if the stylesheet uses xsl:output method="text", the output gets wrapped in something -- in the case of Safari and Chrome, it gets wrapped in an HTML document with a pre element, while in Firefox it gets wrapped in a transformiix:result element. In Opera, the current version of my form doesn't work at all yet, but a test case with some simple transforms shows that in Opera, the output of a text-method XSLT stylesheet is wrapped in a 'result' element (and preceded by an XML declaration). So the result I was seeing with Safari (shown above) seems to indicate that the transformation I was trying to run was producing no output. > > Anyone have a clue? Anyone have a better (or just different) way to go about > this? This continues to be a live question; if I get this working, I'll try to document what I learned, in the hopes that it can help others. Michael -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |