DesignLiquido / xslt-processor

A JavaScript XSLT processor without native library dependencies
GNU Lesser General Public License v3.0
94 stars 30 forks source link

[Question] xslt-processor as library #53

Closed sjehuda closed 1 year ago

sjehuda commented 1 year ago

I'm ignoring node.js completely.

Is it possible to use xslt-processor as a library in a regular page?

I'm ignoring node.js completely.

leonelsanchesdasilva commented 1 year ago

@sjehuda Short answer, yes, but you'll need Browserify for it.

I'll work on a version that works in the browser and it is Node.js independent.

sjehuda commented 1 year ago

I'll work on a version that works in the browser and it is Node.js independend.

That would be great.

Consider that most of the built-in functions delivered in web browsers do not work the same, and some are malfunction (e.g. XSLTProcessor won't work as expected in Gecko when attempting to apply an XSLT stylesheet on Atom, RDF and RSS Feeds), not to mention that most of these built-in parsers and in-browser XSLT support do not support features of XPath and XSLT 2.0 and above.

I have, since, been using DOMParser as an alternative way to parse feeds, and now it works on the Gecko backend too. https://greasyfork.org/en/scripts/465932-newspaper-native-rss-reader

Older version using the built-in XSLTProcessor (not working on Gecko) https://openuserjs.org/scripts/sjehuda/Newspaper_(XMLHttpRequest)

leonelsanchesdasilva commented 1 year ago

@sjehuda This is ready. You can simply import the UMD file as described here: https://github.com/DesignLiquido/xslt-processor#direct-use-in-browsers

sjehuda commented 1 year ago

Thank you!

I didn't know this was possible with Javascript.

I will add xslt-processor and see if it works with Newspaper_(XMLHttpRequest).