[This mail seems to have gone missing somewhere between my outbox and the
mailing list, so I am sending it a second time. Apologies for any duplication.]

A few weeks ago, I ran into an issue with the transform() function in an XForm 
I wrote;
since I think I have now found a solution (or at least a workaround), it may be 
worth
reporting here.  With luck, anyone else who has this problem will find the 
posting via 
a Web search.

Symptom:  when the transform() function is invoked in Safari (or in older 
versions of Chrome),
the form emits an error alert (a modal dialog box) reading "TypeError: null is 
not an object 
(evaluating 'resultDocument.documentElement')".  No result from the transform 
is visible.

This problem arises with all versions of Safari I have tested (5.1.10 on an old 
machine, 
9.0.1 on a newer machine) and older versions of Chrome (30, on the old 
machine).  It does
not arise in Firefox, Opera, or newer versions of Chrome (49).   It also does 
not arise if
in another tab I visit another page that uses the same stylesheet on a static 
document. 

Nor does it arise with all uses of the transform() function.  This turns out to 
be a clue.

A few hours of experimentation eventually showed me that the stylesheet being 
used 
had an xsl:import instruction, and a comparable form that worked properly in 
Safari used
a simpler stylesheet, with no imports or includes.  When I suppressed the 
xsl:import,
the stylesheet started to work properly.  (Once I managed to persuade Safari to 
clear its
cache, that is.)

So it appears that:  in Safari and older versions of Chrome, the transform() 
function does
not deal well with XSLT stylesheets that import (or include, probably, but I 
didn't look
into it) other stylesheets.  The obvious workaround is:  make any stylesheet 
used by
transform() a standalone stylesheet.  (Or I suppose you could forbid your users 
to use 
Safari.  My user, on the other hand, refuses to stop using Safari, and since he 
shares my
desk, I can't just ignore him.)

I have added a note on this topic to the discussion of the transform() function 
in the
XSLTForms wikibook [1].

[1] https://en.wikibooks.org/wiki/XSLTForms/The_transform_function

Regards,

Michael Sperberg-McQueen


-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************





------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Xsltforms-support mailing list
Xsltforms-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xsltforms-support

Reply via email to