Linked CSS contents in XHTML are not included/patched
Brought to you by:
alain-couthures
When xsltforms.xsl is processing an (X)HTML document with a linked CSS resource, it tries loading it with document(@href,/) so its contents are preprocessed/patched. The problem is that XSLT processors usually do not allow reading plain text files (ab)using XSL document function, only XML ones. This happens, for instance, with Firefox 3.0.6, Webkit engine and xsltproc. So, at the end, the translated document contains neither references to the original CSS resource nor translated content of the CSS resource.
I have a suggestion to fix this bug. Using Javascript, it would be easy with XMLHttpRequest to fetch linked CSS resources from the client side, in order to patch them and include as dynamic CSS contents.
I forgot to say that this is with SVN trunk (r406)
Adding a document element such as <css> will permit the XSLT processor to parse CSS instructions.
This is how it is supported now...
-Alain
Thanks for the tip!
A couple of weeks I developed a prototype (it is half-functional) which delegates the job in Javascript code. I'm including the diff and the javascript file after this comment, in the hope it can help.
Diff of the prototype against XSLTForms r407
The javascript code used by generated javascript sentences from previous diff