Hacker News new | ask | show | jobs
by ams6110 5691 days ago
xsl and transforms are what you use to extract data from xml. xslt is the coolest thing about xml IMHO.

the only real complaint I have is that xsl, being itself xml, is pretty verbose and can be tedious to write.

1 comments

xslt is beyond tedious, it is infuriating. There are few use cases for xslt that would not be better served with a procedural technique, eg. python and a parser.

also the whole "using xml to define a transformation on some other xml" thing is so overly meta as to induce a massive brain hemorrhage out of my nose and all over my desk.

Fortunately you can now use XPath for simple queries and XQuery beyond that.
Forgot about them. Both XPath and XQuery are excellent technologies and a probably the best thing about XML in my experience with it. I highly recommend everyone concerned with XML check them out if they havent already. I never seem to see much mention of them around XML discussions.

http://www.w3schools.com/xquery/xquery_intro.asp

> I never seem to see much mention of them around XML discussions.

Which is a shame since I've been banging my head against a particular set of problems for a while with XML, and XQuery nicely resolves that, and I think it's easier to use than SQL for the most part.

Ironically probably the most popular application of XPath in the real world is jQuery selectors! Although I don't know whether that weakens or strengthens the case for JSON...