omg-a-bear

- friends
1,773 link karma
33 comment karma
send messageredditor for
what's this?

TROPHY CASE

  • dust

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin javascript

[–]omg-a-bear[S] 0 points1 point ago

...because? No different than selecting nodes in other types of data structures. I guess you don't like jQuery either then, when using Sizzles selectors?

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin javascript

[–]omg-a-bear[S] 0 points1 point ago

Yet Another JS Template Engine. This is exactly why I would prefer a more standardized way of transforming JSON with templates...

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin javascript

[–]omg-a-bear[S] 3 points4 points ago

Actually, that's not to be fair to say that you can extend functionality - since most users wont. But it's a good point, and I concur - JavaScript engines do give you more flexibility to extensions and it's, in theory, a good thing. Again, I don't have a grudge with JS engines - just that there is no unity or conformity among them. When there's a better alternative like a native JSON transformer in some web browser specification, I will be the first to adapt :)

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin javascript

[–]omg-a-bear[S] 5 points6 points ago

Well, I know what you mean -- but XSLT is so much more powerful than any JavaScript templating engine out there. You can handle more than one match for each template, easy apply different templates for subvalues, a lot of functionality builtin, and so on. I didn't write JXS for anyone but myself when I started it, and sometimes I'm in large scale web applications ($1M+) where it comes really handy to use a more robust, standardized transformation language than just JavaScript templates.

Thanks for the compliment though ;)

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin javascript

[–]omg-a-bear[S] 0 points1 point ago

Awesome! Would like to hear how it works out for you, or if it does :)

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin javascript

[–]omg-a-bear[S] 3 points4 points ago

Thanks! It's fairly new though, and could probably be expanded with more functionality. First stop will be handling some more events (like 'onprogress' or such), feel free to try it out and see what you're missing!

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin programming

[–]omg-a-bear[S] 1 point2 points ago

The main issue with XML web services is the overhead in my experience. The main issue with JSON is that it has no standard transformation language connected to it. JXS is some sort of bridge, which gives you a standardized transformation language for a data protocol with less overhead than XML.

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin programming

[–]omg-a-bear[S] 0 points1 point ago

Awesome, would love to hear how it (if it) works out for you!

Tired of JavaScript template engines? JXS gives you the opportunity to transform JSON with XSLT. by omg-a-bearin programming

[–]omg-a-bear[S] 1 point2 points ago

I know there's a lot of XSL/XSLT bashing out on the net, but I think it serves its purpose really well when transforming data into (in my case) HTML. And I was really tired of all the different JavaScript templating engines out there, tired of all inline HTML-templates, tired of different type of markup. Most web services are using JSON as standard output format, which is natively not compatible with XSLT or any other standard transformation language -- this was why JavaScript templating engines even came to this world.

So I wrote this small library, which enables XSLT transformation to JSON. It's not rocket science in any way, the library simply creates a XML string from a JSON object and parses this with a defined XSLT template.

My first concern was that this would be slow -- but it's really not. Unofficial benchmarks showed that this is as fast as JavaScript template engines for smaller JSON objects/data structures (< 1000 items) but actually faster than JavaScript template engines for large data structures (I tested with > 5000). Of course this didn't apply to Chrome, but the performance loss was minimal (10-20 ms).

So I thought that some of you JavaScript coders out there could benefit from my library as well, and feel free to contribute, bash, come with ideas, or just share your feelings about it.

You Only Wish MongoDB Wasn't Relational by omg-a-bearin programming

[–]omg-a-bear[S] 5 points6 points ago

Hey, hey, hey, this is not my blog post. I have nothing to do with the project referred to in the link, I just thought it was interesting and something one could learn from.

Dissecting the Critical PHP Remote Vuln Introduced in Security Patch for Hashtable Collision DOS by thexploitin programming

[–]omg-a-bear 5 points6 points ago

Lack of peer review is the biggest threat against open projects, as well as consistent peer review is the strongest argument for open projects. This is an example of the former though...

view more: next