2

I've been successfully transforming XML document with XSLT, I'm initiating the process from JavaScript. Since the XML input is fairly large, my plan was to start the XSLT transformation within a webworker.

The error I get at this line var processor = new XSLTProcessor(); is

`Chrome--> Uncaught ReferenceError: XSLTProcessor is not defined 
'Firefox--> XSLTProcessor is not defined`

As I mentioned it previously worked. Does anyone have a suggestion how to get an instance of a XSLTProcessor, within a webworker? I know webworkers are very limited in what they can access.

Thank you !!

Marcel
  • 189
  • 7

1 Answers1

2

Sorry bro, you can't. WebWorkers are not able to access anything related to the DOM or the window object, in your case. As this would not be thread safe, it is forbidden by the browser. Only serializable objects can be passed to a worker, and in addition, you cannot serialize native objects.

For similar questions, see here or here.

Community
  • 1
  • 1
Sammy S.
  • 1,280
  • 1
  • 16
  • 31