usernamenumber (
usernamenumber) wrote2010-03-01 02:32 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Fun with xslt...
One of my specialties at work is an xml dialect that describes how to turn documents written in another arbitrary xml dialect into another-other arbitrary xml dialect. I swear if this gets any more meta, I'm going to gain the power to alter reality around me with my text editor.
Which would be pretty cool.
Which would be pretty cool.
no subject
no subject
no subject
no subject
Metas hacked!
The XML, of course, was usually being used as an intermediary language between two other languages (facepalm).
no subject
I don't use emacs, either. Long live jedit!
no subject
no subject
For starters, there are already a huge number of tools out there for XML. Docbook comes with stylesheets for converting to any number of formats, which we have only to extend for our purposes. That's not really a quality of the language per se, but it is a valid practical consideration.
Then there are things like xpath, which make it possible to do (at least from what I can tell) much more powerful searches of an xml document than of the same data in the JSON libraries I've seen, which basically just import the JSON into native data types and that's that. It seems to me that storing data as an array or basic object is simple, but limiting. For example, how would I say "retrieve all elements of type foo that are nested one or more levels below elements of type bar and have the property baz set to 'hi!'" ("//bar//foo[@baz='hi!']" in xpath) using JSON tools without having to write my own function to iterate over the data? (note: it actually looks like there has been some work to implement xpath for JSON, but only in a couple of languages and not ones I use, so I'm not counting it :P)
Setting tools aside, though, looking at the JSON/XML comparisons on the JSON site, I don't really see it as being that much more "lightweight", at least in terms of producing it. I mean, just looking at the first example, the difference in character counts is only about 5%. Plus, I can't imagine the JSON equivalent of something like:
being less cumbersome than the xml version. I can see JSON being good for describing objects, but it doesn't seem to be a good fit for actual pages worth of prose with inline formatting information. Counter-examples welcome, though.
no subject