AlainCouthures / xsltforms

XForms to XHTML+Javascript (AJAX) conversion based on a unique XSL transformation. Suitable server-side (PHP) or client-side (Google Chrome, Edge, Internet Explorer, Mozilla FireFox, Opera, Safari) browser treatment where an XSLT 1.0 engine is available
37 stars 19 forks source link

Request: Provide a 'CDN' for XSLTForms - suggestion : 'github pages'? #28

Open midijohnny opened 6 days ago

midijohnny commented 6 days ago

This is request to provide XSLTForms with a CDN link. One way to consider doing this: enable 'github pages' for this project (or setup a separate dedicated one).

I notice that github serves XML as 'text/plain' (which means XSLTForms won't load in my browser), but 'github pages' serves the same resource as 'xml/application' which works.

Using 'github pages' means you could also put working examples for XForms directly in the project.

Notes:

# GitHub 'raw'
$ export URL=https://raw.githubusercontent.com/midijohnny/xforms-stuff/refs/heads/main/themes.xml
$ curl -s -I -o /dev/null -w '%{content_type}' ${URL}
text/plain; charset=utf-8
# GitHub Pages:
$ export URL=https://midijohnny.github.io/xforms-stuff/themes.xml
$ curl -s -I -o /dev/null -w '%{content_type}' ${URL}
application/xml
HeikoTheissen commented 4 days ago

How do you intend to use XSLTForms via CDN?

Even if it was available on github.io (or some other CDN),

<?xml-stylesheet type="text/xsl" href="https://xyz.github.io/xsltforms/xsltforms.xsl"?>

could not be used in XForms documents from different origins. For example, Google Chrome refuses to load it:

Unsafe attempt to load URL https://xyz.github.io/xsltforms/xsltforms.xsl from frame with URL https://other.domain/xforms.xml. Domains, protocols and ports must match.